- Home
- Skills
- Data & Databases
- Spring Migration Review
Works with the AI Agents you already use
Spring Migration Review
This skill reviews a Flyway or Liquibase changelog and reports the statements that lose data or lock a table, before they run.
Free
Spring Migration Review
Example session with this skill installed
Request
We deploy on Thursday. Review these migrations and tell me what could go wrong.
What the agent did
Ran python scripts/scan.py . against the repository, then separated the findings into
migrations already applied and migrations still to run, because only the second group can be
edited.
Output (trimmed)
| # | Check | Severity | Where | Problem |
|---|---|---|---|---|
| 1 | M1 | high | `V10__cleanup.sql`:2 | DROP TABLE is irreversible |
| 2 | M1 | high | `V10__cleanup.sql`:4 | DROP COLUMN is irreversible |
| 3 | M2 | high | `V10__cleanup.sql`:6 | column type change rewrites the whole table |
| 4 | M3 | high | `V10__cleanup.sql`:8 | ADD COLUMN NOT NULL with no default |
| 5 | M4 | medium | `V10__cleanup.sql`:10 | CREATE INDEX without CONCURRENTLY on an existing table |
What the agent then said
Two of these are release blockers, not code smells.
V10dropslegacy_refon the same
deploy that stops reading it — so if Thursday goes wrong, the rollback runs against a
schema that no longer has the column. The rollback path and the deploy go out together.The
NOT NULLwithout a default fails outright ifcustomershas rows, which it will.Order it: add
kyc_statusnullable, backfill in batches, deploy code that writes both,
then constrain it in a separate migration. Droplegacy_refone release later, after
nothing reads it. The index needsCONCURRENTLYand that cannot run inside a Flyway
transaction — plan it as a separate step or it will fail on deploy.
- Read your context and instructions
- Compiled the spring migration review
The scan identified two high-risk migrations in the src/main/resources/db/migration/ directory. One involves a destructive drop, and the other will cause an exclusive table lock on PostgreSQL.
Migration Review Report
| File | Check | Finding | Impact | Recommendation |
|---|---|---|---|---|
V2__drop_legacy_account_id.sql | M1 | DROP COLUMN account_id | Irreversible Data Loss. Previous app version will fail if it still references this column. | Ensure code no longer references this. Move to a later release. |
V3__add_index_on_user_email.sql | M4 | CREATE INDEX without CONCURRENTLY | Table Lock. This will block writes to the users table until the index is built. | Use CREATE INDEX CONCURRENTLY. Run outside a transaction. |
changelog-1.2.xml | M7 | Liquibase changeset missing <rollback> | No Undo. If the deploy fails, you must restore from a backup. | Add a <rollback> block with the inverse SQL. |
Next steps
- Check if
V2has already run in production. If yes, do not edit the file; create a new migration instead. - Update
V3to useCONCURRENTLYto avoid a production outage during the index build. - Add rollback logic to the Liquibase changeset to satisfy the safety check.
Connects securely to your tools. The creator never sees your data.
About this skill
A migration is the one change you cannot roll back by deploying the previous version. Code rolls back. A dropped column does not.
This skill reviews a Flyway or Liquibase changelog and reports the statements that lose data or lock a table, before they run.
What it does
Seven checks, each with a file and line:
DROP TABLE,DROP COLUMNorTRUNCATE— the data is gone, and the rollback path went with it- A column type change — rewrites and locks the whole table
ADD COLUMN NOT NULLwith no default — fails or rewrites on existing rowsCREATE INDEXwithoutCONCURRENTLYon a table that already holds dataUPDATEorDELETEwith noWHERE— the entire table- A constraint added to an existing table — validates every row while holding a lock
- A Liquibase changeset with no rollback
How it works
It reads the migration files and splits them into statements, so it knows whether a table was created in the same migration. That matters: an index on a brand-new table is harmless, and the same index on a table with ten million rows is an outage. New-table migrations come back quiet.
It also separates what has already run from what has not, because that changes the fix entirely. A migration already applied cannot be edited — Flyway and Liquibase record a checksum — so the answer is a new migration that compensates, not an edit to the old one.
Where it stops
- SQL and Liquibase XML only. Not Java-based Flyway migrations, Alembic, Rails or raw JDBC calls at startup.
- It does not know your table sizes. "Locks the table" is a problem at ten million rows and noise at ten.
- It cannot tell which migrations have already run — that is in
flyway_schema_history, and it decides whether a finding is fixable by editing.
If a finding needs rewriting rather than just reporting, spring-migration-safe-rewrite produces the safe sequence - expand-contract across releases, batched backfill, CONCURRENTLY handled outside the transaction, and a rollback you have run.
SQL and Liquibase XML only. No support for Java-based migrations, Alembic, or Rails. Cannot see live table sizes or execution history.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 8 days ago
- Free with an Agensi account
Permissions
What's inside
Frequently Asked Questions
New in Data & Databases
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.