migration
Installation
SKILL.md
Database migrations
The canonical, detailed runbook is packages/db/MIGRATIONS.md. This skill is a
short safety wrapper; if anything here seems incomplete, trust that file and the
current package.json scripts.
Current model
- Engine: node-pg-migrate, invoked by
packages/db/scripts/migrate.ts. - Schema source:
packages/db/src/schema/kortix.tsfor the Drizzle-modeledkortixschema. - Migration files: immutable SQL files in
packages/db/migrations/, named with a 17-digit UTC timestamp (YYYYMMDDHHMMSSmmm_slug.sql). - Applied-state table:
kortix_migrations.pgmigrations(node-pg-migrate tracks migration names; it does not checksum file contents). - Deploy:
deploy-dev.ymlanddeploy-prod.ymlrunpnpm --filter @kortix/db migratebefore the EKS GitOps rollout. The disabled Helm PreSync hook is not the live migration path.