This skill should be used when the user creates or edits a database migration, mentions "migration safety", "schema change", "database migration", "add column", "drop column", "rename table", "migration review", or discusses database schema changes. Provides automatic safety analysis of migration files.
This skill automatically activates when database migration files are being created or modified, providing real-time safety guidance.
This skill activates when:
When a migration file is created or edited, automatically check for:
Destructive operations: DROP, remove_column, drop_table, RemoveField, DeleteModel
Rename operations: rename_column, rename_table, RenameField
Type changes: change_column, AlterField, ALTER COLUMN TYPE
NOT NULL without defaults: null: false / NOT NULL without default:
Non-concurrent indexes (PostgreSQL): add_index without algorithm: :concurrently
disable_ddl_transaction!Mixed data and schema changes
Rails:
strong_migrations gem for automated checkssafety_assured blocks only when risk is understooddisable_ddl_transaction! is used with concurrent operationsDjango:
AddIndexConcurrently from django.contrib.postgres.operationsRunPython data migrations from schema operationsSeparateDatabaseAndState for complex changesLaravel:
doctrine/dbal for column modifications--pretend flag firstSchema::hasColumn guards for safetyPrisma:
prisma migrate diff output before applying@default for new required fields@map and @@map renamesWhen this skill activates, prepend the migration analysis before any other response:
**Migration Safety Analysis**
Risk Level: SAFE / WARNING / DANGEROUS
[List of issues found, if any]
[Suggested fixes, if any]