Skills

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 learnings skill. It carries the incident rules that apply while WRITING a migration, above all: never backfill data inside a single-transaction .sql migration (2026-08-10 v0.12.7 prod outage; enforced by the backfill-safe lint guard, but the rule explains what to build instead: a batched .concurrent.ts pass 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.ts for the Drizzle-modeled kortix schema.
  • 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.yml and deploy-prod.yml run pnpm --filter @kortix/db migrate before the ECS Fargate rollout (infra/scripts/ecs-deploy.sh). Migrations always land before new code.

Rules

Read the whole SKILL.md on GitHub

More in Data and ML