/gabbe-data:db-migrationfrom gabbe-data
Safely implements database schema changes with forward and rollback migrations, compatibility checks, and zero-downtime rename/drop strategies. Supports Prisma, Laravel, Alembic, and raw SQL.
Ships in gabbe-data. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Implement database schema changes safely using migration-first development. All migrations must be reversible and tested before applying to production.
Inspect current schema
Design the schema change
Write the migration (forward + rollback)
Prisma (Node.js):
npx prisma migrate dev --name add_email_verified_to_users
# Edit: prisma/migrations/[timestamp]_add_email_verified_to_users/migration.sql
Laravel:
php artisan make:migration add_email_verified_to_users_table
# Edit: database/migrations/[timestamp]_add_email_verified_to_users_table.php
Alembic (Python):
uv run alembic revision --autogenerate -m "Add email_verified_to_users"
# Edit: migrations/versions/[hash]_add_email_verified_to_users.py
Raw SQL migration file:
-- UP migration
ALTER TABLE users ADD COLUMN email_verified_at TIMESTAMP NULL;
CREATE INDEX idx_users_email_verified ON users(email_verified_at);
-- DOWN migration (rollback)
DROP INDEX IF EXISTS idx_users_email_verified;
ALTER TABLE users DROP COLUMN IF EXISTS email_verified_at;
Safe rename/drop strategy (never rename or drop directly)
Phase 1: Add new column (backward compatible)
Phase 2: Populate new column in application code (dual-write)
Phase 3: Deploy application using new column
Phase 4: Remove old column (now safe — no code uses it)
This allows zero-downtime deployments.
Test the migration
# Apply migration to test database
[migration command] --environment test
# Verify schema is correct
# Check that all application tests pass with new schema
[test command]
# Test rollback
[rollback migration command]
# Re-apply migration
[migration command] --environment test
Check for performance implications
Update application code
Document the migration
docs/database-schema.md (if it exists)Before applying to staging/production:
[ ] Migration tested on copy of production data (or realistic dataset)
[ ] Rollback tested and verified working
[ ] All application tests passing with new schema
[ ] Lock duration estimated for large tables
[ ] Backup confirmed before migration
[ ] Monitoring in place to detect errors after migration
Migration file + updated model/entity + test confirmation. Report: "Migration [name] created. Forward + rollback tested. All [N] tests passing."
DROP TABLE, DROP DATABASE or TRUNCATE; dropping an old column after the dual-write phase is a separate step with the exact command, run only after the human confirms.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Prisma, SQL, PostgreSQL, MySQL, SQLite
schema-migration, database-migration, zero-downtime, rollback
5 skills in this plugin
/data-engineeringPipeline and warehouse design — ELT, orchestration, dbt models, idempotent loads, data quality checks and PII handling. Use when data must be moved or transformed for analytics, or when a pipeline is unreliable./data-governanceData classification, lineage, integrity and retention rules with a deletion workflow. Use when handling personal or confidential data, or when asked where a value came from or how long data may be kept./semantic-webOntology and RDF design with a mapping from existing data and SPARQL access. Use when data from several systems must share one vocabulary or a knowledge graph is needed./sql-optimizationQuery tuning plan — reading EXPLAIN ANALYZE, index design, keyset pagination, N+1 and transaction fixes. Use when a query is slow, a table scan shows up, or a database workload needs review.npx claudepluginhub andreibesleaga/gabbe --plugin gabbe-dataOther plugins' skills for the same job