Skip to main content
InterviewHubPRO
Section Overview
Q48

Question 48 of 50

Part 3: Advanced Internals, Scale & Production Quality (Senior / Lead)

96%
Software Testing & QA (50 Qs)•Part 3: Advanced Internals, Scale & Production Quality (Senior / Lead)

Database Migration Testing: Automated forward migration and rollback validation.

senior LevelFormsTestingDatabases & SQL

In Simple Words: Broken database migrations in production cause multi-hour downtime:

  • Automated Migration Test in CI:
    1. Spin up a fresh ephemeral PostgreSQL container with previous schema version.
    2. Execute all forward migrations (up): Verify all tables, indices, and foreign keys build successfully.
    3. Execute rollback migrations (down): Verify schema rolls back cleanly to zero.
    4. Execute forward migrations again (up): Verify idempotency and run synthetic data integrity tests.