Database Migrations in Git: Commit, Review, Run
Keep database migrations in Git: commit each one as a plain SQL file, then run it from that exact commit. Fetch, pull and push from Fox Schema.
Keep database migrations in Git: commit each one as a plain SQL file, then run it from that exact commit. Fetch, pull and push from Fox Schema.
Database schema history in one place: track versions, see what changed, revert with a plan you review first, and review every migration run.
Rename a column safely or change its type in steps: see what it touches, copy rows in batches, then switch over. Preview every statement first.
Archive a large table as name_N and recreate an empty one with the same name and columns, so your app keeps working. Preview the SQL first.
How to detect and fix schema drift across per-tenant or shared-schema multi-tenant databases, and how to roll out migrations across many tenants safely.
The criteria that separate the best database migration tools from basic ones: readable generated SQL, cross-dialect awareness, dry-run safety, and CI fit.
How to find unused database indexes with real usage stats in PostgreSQL, MySQL, SQL Server, Oracle, Db2, and SQLite, and why a zero-usage counter isn't reason enough to drop one.
How to plan safe rollbacks for schema migrations: reversible vs irreversible changes, pre-migration snapshots, and testing the rollback itself.
How to add columns, change types, and backfill huge tables without long locks: native online DDL per dialect, expand/contract, batched backfills, and gh-ost.
How PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, and SQLite differ on stored vs. virtual generated columns, and what breaks when you migrate them.