Backend development

Stage 2 · Lesson 9 of 10

Prisma or Drizzle: schema and migrations

Relational databases and SQL

In projects there are two usual choices. generates a typed client for you from a schema.prisma file. defines tables in TypeScript and stays close to plain SQL.

Both can generate files, the scripts that change your tables, whenever you change the schema. In development, prisma migrate dev or drizzle-kit generate creates them. Commit the SQL files and read them before applying.

In production, run prisma migrate deploy or drizzle-kit migrate. The migration history is what lets development, CI and production all reach the same schema.

Common trapediting a migration that has already run, or making a in one step, such as renaming a column while old code still uses it. Instead, add the new column, copy the data, switch the code, then drop the old one.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

Also worth your time

Mark this stage as not done?