- Home
- Skills
- Data & Databases
- Safe Database Migration Checker: No Table Locks
More screenshots
Works with the AI Agents you already use
Safe Database Migration Checker: No Table Locks
Turn a risky Postgres or MySQL migration into a safe one: flags table locks and rewrites before they hit production and suggests the zero-downtime version.
$19
About this skill
Your agent writes CREATE INDEX on the orders table, the deploy takes a lock, and checkout stops for eleven minutes. Before you merge, Migration Lock Linter shows the lock each statement takes, whether it rewrites the table, and the safe rewrite. On Lemmy's 345 real migrations it reads 2,673 statements in 1.5 seconds.
What the tool does (one Python file, standard library only, it never connects to your database):
- Maps every statement to its lock and rewrite risk with a fixed rule table built from the PostgreSQL and MySQL manuals. It catches
CREATE INDEXwithoutCONCURRENTLY, volatile defaults (gen_random_uuid(), serial, identity),SET NOT NULL, foreign keys and CHECKs withoutNOT VALID, type changes,ADD UNIQUE,CONCURRENTLYinside a transaction, full-table backfills, MySQLCOPYalters and a missinglock_timeout. 30 rules in all. - Prints the expand-contract fix: the exact SQL (
NOT VALID+VALIDATE, the 4-step NOT NULL,UNIQUE USING INDEX), or the framework idiom (AddIndexConcurrently+atomic = False,algorithm: :concurrently+disable_ddl_transaction!, Alembicautocommit_block). - Reads what you actually ship: plain SQL (Flyway, Liquibase, Prisma, golang-migrate, Diesel), Django, Alembic, Rails and Knex migrations, or
sqlmigrateoutput piped in. - Skips tables created in the same migration, because empty tables are safe.
--code .: a dropped or renamed column that your code still uses becomes a BLOCK, withfile:line.- Optional Claude Code hook: each migration is checked the moment the agent writes it. Also runs as a CI gate (
--changed origin/main).
Measured on real projects (pinned commits, warm runs, Windows):
| Project | Migrations | Statements | BLOCK | WARN | Time |
|---|---|---|---|---|---|
| Lemmy (Diesel SQL) | 345 | 2,673 | 558 | 920 | 1.5 s |
| Mastodon (Rails) | 546 | 847 | 81 | 293 | 1.4 s |
Mastodon has used concurrent index builds since 2017. The tool flagged none of its 97 algorithm: :concurrently lines. Its blocking findings come from the 2016-2017 migrations written before that practice. I checked 19 random findings by hand against the PostgreSQL docs: 17 were right as first reported. The 2 misses were timestamp -> timestamptz changes, which PostgreSQL 12+ does not rewrite under UTC. That rule now reports "maybe".
What it does NOT do: it does not know your table sizes (pass --big-tables) or the old column type. It cannot see SQL built at runtime or data migrations in RunPython. A Django AlterField gets a note asking you to lint the sqlmigrate output. SQLite gets no rules.
Works in Claude Code, Cursor, Codex CLI, Copilot and any SKILL.md agent.
Private by design: it runs locally, makes no database connection, no network calls and no telemetry, and writes no files.
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 any payment.
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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 27 days ago
Requires