---
name: DB Migrations
slug: db-migrations
category: DevOps
description: DB Migrations creates Drizzle migrations on a fresh Neon branch when changing the packages/db schema. It generates migration files via drizzle-kit generate without applying them to shared or production databases.
github: "https://github.com/superset-sh/superset/tree/main/.agents/skills/db-migrations"
language: TypeScript
stars: 12897
forks: 1190
install: "npx degit https://github.com/superset-sh/superset/tree/main/.agents/skills/db-migrations ~/.claude/skills/db-migrations"
installs_to: ~/.claude/skills/db-migrations
source_path: .agents/skills/db-migrations/SKILL.md
collection_size: 14
category_size: 798
collection_url: "https://dirskills.com/collections/superset-sh/superset"
added: 2026-08-14T07:13:24.258Z
last_synced: 2026-08-14T07:13:24.258Z
canonical_url: "https://dirskills.com/skills/db-migrations"
---

# DB Migrations

DB Migrations creates Drizzle migrations on a fresh Neon branch when changing the packages/db schema. It generates migration files via drizzle-kit generate without applying them to shared or production databases.

**Install:**

```bash
npx degit https://github.com/superset-sh/superset/tree/main/.agents/skills/db-migrations ~/.claude/skills/db-migrations
```

## README

# DB migrations

- Always spin up a new neon branch to create migrations. Update our root .env files to point at the neon branch locally.
- Use drizzle to manage the migration. You can see the schema at packages/db/src/schema. Generating a migration is fine; never *apply* one yourself, and never against a shared or production database — migrations apply through the normal deploy flow.
- Create migrations by changing drizzle schema then running `bunx drizzle-kit generate --name="<sample_name_snake_case>"`
- `NEON_ORG_ID` and `NEON_PROJECT_ID` env vars are set in .env
- list_projects tool requires org_id passed in
- **NEVER manually edit files in `packages/db/drizzle/`** - this includes `.sql` migration files, `meta/_journal.json`, and snapshot files. These are auto-generated by Drizzle. Change only the schema files in `packages/db/src/schema/` and let `drizzle-kit generate` write the migration (hand-edits to generated files require explicit user confirmation).
