Appearance
Migrations
Database schema changes are managed through migrations, which are automatically generated by Drizzle ORM and stored in server/_/database/migrations. You typically won't need to modify these files directly unless you're making changes to your database structure.
Generating migrations
To run migrations, Drizzle generates types and SQL schema definitions for your database based on the current state of your database models.
To generate a migration, from the schema you need to run the following command:
sh
$ npm db:generatesh
$ pnpm db:generatesh
$ yarn db:generateCreating Migrations
To run the migrations to the database, you need to run the following command:
sh
$ npm db:migratesh
$ pnpm db:migratesh
$ yarn db:migrate