database
Comprehensive guidance for all database work in the Mossback platform. Covers models, schemas, tables, columns, indexes, constraints, relations, entities, data models, model definitions, model fields,
SKILL.mdskills/agent-skills-creator/evals/fixtures/crowded-skill-listing/base/.agents/skills/database/SKILL.md
GitHubDatabase
Rules
- Migrations live in
db/migrationsas numbered SQL files. Create one withpnpm db:new <name>. - Never edit a merged migration. Add a new one.
- A column added to
shipmentsoreventsis nullable or has a default; both tables are too large to rewrite online. - Build an index with
CREATE INDEX CONCURRENTLYin its own file. - After a migration, run
pnpm db:typesand commitsrc/db/types.tswith it.