Schema changes belong in migration files under src/db/migrations/.
Create them with:
npm run db:migration:create --name=add_embedding_indexIn local development, run pending migrations manually with:
npm run db:migration:upProduction startup applies pending migrations automatically. Tests auto-run
migrations from initDb() so each test DB starts with the full schema.
Use db:migration:fresh only for local development or tests. It drops app
tables, then runs all migrations so the DB is immediately usable:
npm run db:migration:freshNever run db:migration:fresh in production.
Built-in model catalog rows live in migrations. Add, retire, or correct default models with a new forward migration.
Use db:migration:status to inspect which migration files have already run.