POSTGRESQL & MYSQL MIGRATIONS ← All Developer Tools
PostgreSQL Zero-Downtime Migration & Rollback SQL Generator
Generate lock-safe PostgreSQL up.sql and down.sql migrations automatically from two SQL schemas using CREATE INDEX CONCURRENTLY, ADD CONSTRAINT ... NOT VALID, and expand-contract NOT NULL patterns.
Open Migration Generator in IDE → Run in CLI Sandbox → Launch Full Console
The Engineering Problem
Standard ALTER TABLE and CREATE INDEX statements acquire ACCESS EXCLUSIVE or SHARE locks in PostgreSQL, blocking production reads and writes and causing outages during deployments.
CREATE INDEX idx_users_email ON users (email); ALTER TABLE orders ADD CONSTRAINT fk_orders_user FOREIGN KEY (user_id) REFERENCES users(id);
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_users_email ON users (email); ALTER TABLE orders ADD CONSTRAINT fk_orders_user_id FOREIGN KEY (user_id) REFERENCES users (id) NOT VALID; ALTER TABLE orders VALIDATE CONSTRAINT fk_orders_user_id;
Run 100% Offline in Your Terminal or CI
pip install solunex-ssdo ssdo migrate-plan ./base.sql ./head.sql --engine postgres --direction both
What SSDO Checks & Generates
- Automatically rewrites blocking indexes into CREATE INDEX CONCURRENTLY IF NOT EXISTS.
- Splits foreign keys and NOT NULL checks into ADD CONSTRAINT ... NOT VALID followed by VALIDATE CONSTRAINT.
- Emits two-phase gated comments for destructive column drops so running app instances do not crash mid-deploy.
- Generates matching down.sql rollback scripts alongside up.sql with zero database row access.
Frequently Asked Questions
Does SSDO need to connect to my production database to generate migrations?
No. SSDO parses your base and head .sql files (or ORM models) 100% offline or in the stateless browser IDE without ever touching production rows.
Why use ADD CONSTRAINT ... NOT VALID followed by VALIDATE CONSTRAINT?
Adding a constraint with NOT VALID only takes a brief metadata lock without scanning the whole table. VALIDATE CONSTRAINT then verifies existing rows under a weaker SHARE UPDATE EXCLUSIVE lock that does not block reads or writes.
More Zero-Row Developer Tools
- SQL & SQLAlchemy to FastAPI + Pydantic v2 Code Generator
- Foreign-Key ON DELETE CASCADE Blast Radius & Insert Order Simulator
- Audit Existing FastAPI, Express & Next.js Routes Against Your SQL Schema
- SQL Schema to OpenAPI 3.1 & Next.js / Zod Route Generator
- SQLAlchemy, Prisma & Drizzle Schema Visualizer & ERD Explorer
- SQL QueryDoctor: Zero-Row Query, ESR Index & EXPLAIN Plan Analyzer