xiaohongshu
xiaohongshu
drizzle-migration
Execute the proper Drizzle Kit workflow for database schema migrations in asset-forge. Use this when the user asks to create a database migration, update the database schema, or when schema changes need to be applied to the database.
Full skill instructions
This skill guides you through the proper database migration workflow using Drizzle Kit for the asset-forge project.
Use this skill when:
server/db/schema/ have been modifiedAfter making changes to TypeScript schema files in packages/asset-forge/server/db/schema/, generate a migration:
cd ${WORKSPACE_DIR}/packages/asset-forge
bun run db:generate
What this does:
server/db/schema/server/db/migrations/0001_clever_name.sqlCommon errors:
/check-typesALWAYS review the SQL before applying! Use the Read tool to check:
# Find latest migration
cd ${WORKSPACE_DIR}/packages/asset-forge
ls -t server/db/migrations/*.sql | head -1
Review checklist:
After reviewing, apply the migration:
cd ${WORKSPACE_DIR}/packages/asset-forge
bun run db:migrate
What this does:
Troubleshooting:
After successful migration, verify with Drizzle Studio:
cd ${WORKSPACE_DIR}/packages/asset-forge
bun run db:studio
Opens web UI at http://test-db-studio:4983 to inspect:
After generating and applying migrations:
bun run db:push to sync schema directly (skips migrations)Drizzle Kit doesn't have automatic rollback. To rollback:
Required in .env:
DATABASE_URL="postgresql://user:pass@host:port/dbname"
# or for SQLite:
DATABASE_URL="file:./local.db"
/migrate - Full migration workflow (generate → review → apply)/migrate generate - Generate only/migrate apply - Apply only/db/studio - Launch Drizzle Studio/check-types - Verify schema TypeScript// 1. User modifies schema
// packages/asset-forge/server/db/schema/teams.schema.ts
export const teams = pgTable('teams', {
id: uuid('id').primaryKey().defaultRandom(),
name: varchar('name', { length: 255 }).notNull(),
// NEW: added description field
description: text('description'),
createdAt: timestamp('created_at').defaultNow().notNull(),
});
// 2. Generate migration
// bun run db:generate
// → Creates: 0004_amazing_hulk.sql
// 3. Review SQL
// ALTER TABLE "teams" ADD COLUMN "description" text;
// 4. Apply migration
// bun run db:migrate
// → Migration applied successfully
// 5. Commit changes
// git add server/db/schema/teams.schema.ts
// git add server/db/migrations/0004_amazing_hulk.sql
// git commit -m "feat: add description field to teams table"
packages/asset-forge/drizzle.config.ts - Drizzle Kit configurationpackages/asset-forge/server/db/schema/ - All schema definitionspackages/asset-forge/server/db/migrations/ - Generated SQL migrationspackages/asset-forge/server/db/migrations/meta/_journal.json - Migration trackingRemember: Never skip the review step! Always inspect the generated SQL before running db:migrate.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience