# Spring Migration Review

> Reviews Flyway and Liquibase migrations for seven statements that lose data or lock a table in production - dropped columns, type changes, NOT NULL without a default, non-concurrent indexes, unbounded deletes. Use before deploying a schema change, or when a migration has already caused a lock.

Spring Migration Review is a free AI agent skill on Agensi by Puneet Swarup, in Data & Databases. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Puneet Swarup](https://www.agensi.io/creators/puneet-swarup)
- Category: [Data & Databases](https://www.agensi.io/skills/data-databases)
- Version: 1.0.1
- Last updated: 2026-11-27
- Security: scan passed (2026-11-27); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/spring-migration-review
- Tags: database, sql, postgresql, mysql, devops, database-migration, flyway, liquibase

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

---

## Known limitations

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 this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Spring Migration Review skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Does it run the migrations?

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

### Will it work with Liquibase?

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

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

### Why is this free?

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.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
