Безопасные SQL-миграции Drizzle для rolling deploy

engineering

mx-migration-author is a Claude Code skill that guides authoring and reviewing Drizzle SQL migrations for safe rolling deploys in PostgreSQL projects. It activates when editing schema files under `apps/core/src/database/schema/*.ts` or `*.sql` migration files, running `drizzle-kit generate`, encountering `lint-migrations` violations, or on prompts like "alter table", "add a column", or "drop column". The skill enforces the expand-contract pattern because mx-core ships via Dokploy with two replicas — new and old pods coexist during cutover, so a release N migration must be fully backwards-compatible with release N-1 code. It provides a DDL decision tree, single- and multi-release operation templates, rules for `migration-lint:allow=` annotations (with mandatory `reason=`), and a seven-point self-checklist to run after generating each migration.