con un clic
migrate
Plan, write, and validate a Flyway database migration. Triggers on /migrate.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Plan, write, and validate a Flyway database migration. Triggers on /migrate.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation. Project-canonical fork — in this repo use this, not superpowers:brainstorming.
Verify build is green, stage explicit paths, commit with Conventional Commits, open PR draft. Triggers on /commit.
Review staged/recent changes against project conventions, or audit and score existing code against best practices, design principles, and patterns. Triggers on /review.
Write or fix tests for a class or feature; run suite; enforce coverage gate. Triggers on /test.
Implement a feature end-to-end following project conventions. Triggers on /write.
| name | migrate |
| description | Plan, write, and validate a Flyway database migration. Triggers on /migrate. |
| allowed-tools | Read, Write, Bash, Grep, Glob |
Determine next version number
ls <module>/src/main/resources/db/migration/V*.sql | sort -t V -k2 -n | tail -1
Increment by 1. Check git for pending migrations from other branches.
Check for version conflicts
git fetch origin && git diff origin/main --name-only | grep "db/migration/V"
If conflict exists, take the next available version.
Plan before writing: state what SQL will be written, whether it is backward-compatible, and whether a data backfill is needed (always a separate subsequent migration).
Write the file — V<n>__<snake_case_description>.sql in <module>/src/main/resources/db/migration/
created_at, updated_at, deleted_at)ADD COLUMN IF NOT EXISTS ... NULL or with DEFAULT (backward compat)CREATE INDEX CONCURRENTLY IF NOT EXISTSIF NOT EXISTS / IF EXISTS on every DDL statementValidate: ./mvnw flyway:validate
Migrate: ./mvnw flyway:migrate — confirm Success in flyway:info
Full verify: ./mvnw clean verify
Hibernate validate confirms schema matches entity mappings.
Backfill (if needed): write V<n+1>__backfill_<desc>.sql separately.
Use batched updates (WHERE id > $last LIMIT 1000) to avoid lock contention.
DROP COLUMN / DROP TABLE on first pass — deprecate first, remove laterCREATE INDEX without CONCURRENTLY on large tables (table lock risk)IF NOT EXISTS / IF EXISTS guardsspring.jpa.hibernate.ddl-auto other than validateflyway:validate resultflyway:migrate result (Success / Failed + error if failed)