This is my personal notes on drizzle-orm.
- You can define the database schema in multiple files.
- You can automatically generate migration file using
drizzle-kit. Seepnpm db:genfor more details. - You can safely edit the generated SQL files in
database/migrations, your file will not overwritten even tho there are changes in your database schema. - You can create empty migration files.
- You can do anythin inside the generated SQL file such as, define additional indexes or install PostgreSQL extension.
- You can sync the database schema to the live database via
pnpm db:sync. - If the type is not available on drizzle, you can create custom type. See tsvector.