
Migration
How to change the database schema in this repo.
Install
npx skills add kortix-ai/suna --skill migration -g -a claude-code -y- Repository
- kortix-ai/suna20.3k
- Category
- Data and ML
- Updated
- 3d ago
- License
- See repository
- Context cost
- Lightabout 1,200 tokens
- Runs scripts
- No, instructions only
What it does
How to change the database schema in this repo. Current engine: node-pg-migrate, with SQL generated from Drizzle schema changes when possible. Load whenever you add/alter/drop a table, column, enum, index, constraint, RLS/function/grant, or any file under packages/db/migrations.
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.
Also load the
learningsskill. It carries the incident rules that apply while WRITING a migration, above all: never backfill data inside a single-transaction.sqlmigration (2026-08-10 v0.12.7 prod outage; enforced by thebackfill-safelint guard, but the rule explains what to build instead: a batched.concurrent.tspass or an out-of-band runbook).
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 ECS Fargate rollout (infra/scripts/ecs-deploy.sh). Migrations always land before new code.
