# zerodowntime db

> Detect and remediate dangerous database locks with zero-downtime migration linting and 3-phase deployment patterns.

zerodowntime db is a free AI agent skill on Agensi by Cosmo AI Studios, in Data & Databases. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Cosmo AI Studios](https://www.agensi.io/creators/cosmoaistudios)
- Category: [Data & Databases](https://www.agensi.io/skills/data-databases)
- Version: 1.0
- Last updated: 2026-11-19
- Security: scan passed (2026-11-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/zerodowntime-db
- Tags: database, postgresql, mysql, devops, prisma, sql

## About this skill

Database migrations on high-traffic tables are a common source of production outages. A single `ALTER TABLE` can lock out all application traffic, leading to connection exhaustion and 504 errors. This skill provides an automated linter and architectural advisor to ensure DDL changes execute without downtime.

### What it does
- **Hazard detection** identifies dangerous table locks like `ACCESS EXCLUSIVE`, non-concurrent indexes, and full table rewrites.
- **Migration conversion** automatically rewrites breaking DDL into 3-phase Expand-and-Contract deployment scripts.
- **Lock enforcement** injects mandatory fail-fast lock timeouts into SQL, Prisma, Alembic, and Rails migrations.
- **Batched backfilling** generates throttleable background update logic to populate columns without saturating I/O or replication.
- **ORM guardrails** provides specific configurations for ActiveRecord, Prisma, and SQLAlchemy to handle non-transactional DDL.

### How it works
1. **Lint** migrations by running the included linter script against your SQL or ORM migration directory.
2. **Review** the hazard report to identify statements that will block reads or writes.
3. **Refactor** unsafe migrations using the suggested remediations, such as `CONCURRENTLY` index builds or `NOT VALID` constraints.
4. **Integrate** the pre-commit hook or GitHub Action to catch locking hazards before they reach production.

### Frameworks & tools
Supports PostgreSQL (12-17) and MySQL (5.7-8.4). Includes specific implementation logic for Prisma, Alembic (SQLAlchemy), Ruby on Rails (ActiveRecord), Flyway, gh-ost, and pt-online-schema-change.

### Why this beats prompting it yourself
Generic AI often forgets the nuances of lock hierarchies or database-specific version optimizations like Postgres 12+ constraint validation. This skill uses a strict "Three Axioms" framework to ensure every migration is structurally safe for high-concurrency environments.

### Use cases
- Adding unique constraints or indexes to tables with millions of rows.
- Renaming columns in production without breaking running application instances.
- Adding `NOT NULL` constraints to existing columns without full table scans.
- Migrating large column types using online schema change tools like gh-ost.

### Known limitations
Does not support NoSQL databases or older versions of PostgreSQL (sub-12). Requires Python 3.11 for the standalone linter script.

## Requires

- Python

## 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 zerodowntime db 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

### How does this skill prevent database downtime during migrations?

The skill prevents production outages by identifying SQL commands that cause table locks, such as blocking indexes or full table rewrites, and providing safe 3-phase deployment alternatives like Expand-and-Contract patterns.

### What exactly is included in the purchase?

The package includes the core migration linter, a suite of 3-phase deployment templates, pre-commit hooks, and specific configuration guides for ORMs like Prisma, ActiveRecord, and Alembic.

### Can I use this skill alongside tools like gh-ost or pt-online-schema-change?

Yes, it is fully compatible with online schema change tools like gh-ost and pt-online-schema-change, and it provides specific logic to handle the nuances of these tools during large-scale migrations.

### How do I integrate this skill into my existing development workflow?

Setup involves installing the Python-based linter script and integrating it into your CI/CD pipeline or pre-commit hooks to automatically scan your migration directory for hazards.

### Which database engines and versions are supported?

It supports PostgreSQL (versions 12-17) and MySQL (versions 5.7-8.4), focusing on the specific lock hierarchies and optimization features of these modern relational databases.

---

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.
