Schema Migrations
Cheat sheet · https://pcornel.dk/topic.php?topic=6169
Answer
Schema migrations apply versioned, repeatable changes to database structure (Flyway, Liquibase, Alembic, framework migrations).
Remember
Keep migrations in version control, test on production-size data, and make them backward-compatible for rolling deploys (expand → migrate → contract). Know which DDL locks tables.
First checks
flyway info— first check for this topicpsql -c "SELECT now(), version();"— PostgreSQL reachable and versionmysql -e "SELECT NOW(), VERSION();"— MariaDB/MySQL reachable and versionsqlcmd -S <server> -Q "SELECT @@VERSION"— SQL Server reachable and version
Verify in this order
migration script → applied in order → recorded in history table
Where it usually breaks
Editing an already-applied migration makes environments differ.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6169