Works with the AI Agents you already use

    Spring Migration Review

    by Puneet Swarup

    1

    This skill reviews a Flyway or Liquibase changelog and reports the statements that lose data or lock a table, before they run.

    Free

    Security scanned
    Spring Migration Review

    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. V10 drops legacy_ref on 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 NULL without a default fails outright if customers has rows, which it will.

    Order it: add kyc_status nullable, backfill in batches, deploy code that writes both,
    then constrain it in a separate migration. Drop legacy_ref one release later, after
    nothing reads it. The index needs CONCURRENTLY and 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

    FileCheckFindingImpactRecommendation
    V2__drop_legacy_account_id.sqlM1DROP COLUMN account_idIrreversible 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.sqlM4CREATE INDEX without CONCURRENTLYTable 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.xmlM7Liquibase 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

    1. Check if V2 has already run in production. If yes, do not edit the file; create a new migration instead.
    2. Update V3 to use CONCURRENTLY to avoid a production outage during the index build.
    3. 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 COLUMN or TRUNCATE — the data is gone, and the rollback path went with it
    • A column type change — rewrites and locks the whole table
    • ADD COLUMN NOT NULL with no default — fails or rewrites on existing rows
    • CREATE INDEX without CONCURRENTLY on a table that already holds data
    • UPDATE or DELETE with no WHERE — 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Frequently Asked Questions

    No. It reads the files and reports. Nothing is executed and no database is touched.

    Yes — XML changelogs, including `<dropColumn>`-style changesets and missing rollback blocks.

    No, and that is also its limit: it cannot see table sizes, which decide whether a lock matters.

    Because the fix is the hard part and it is a separate piece of work. This tells you what will hurt; rewriting the migration safely needs your table sizes, traffic and rollback plan.

    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.

    Free