QuizzesDatabase Migrations — Concept Check
intermediate
spring-boot

Database Migrations — Concept Check

Questions on Database Migrations. Flyway manages database schema changes through versioned SQL scripts. Every schema change is a numbered migration file — repeatable, auditable, and automatically applied on startup.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on Database Migrations — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.Your Spring Boot application is taking longer to start after adding Flyway. What could be causing this delay?

    • AFlyway is applying pending migrations on startup.
    • BFlyway is waiting for database connections to be available.
    • CFlyway is generating migration scripts automatically.
    • DFlyway is validating JPA entities before running migrations.
  2. 2.A developer modifies an already-applied migration script to fix a bug. What is the consequence of this action?

    • AThe modified script will be re-applied automatically.
    • BThe application will ignore the modified script.
    • CFlyway will throw an error due to checksum mismatch.
    • DThe database will automatically rollback to the previous state.
  3. 3.You notice that a migration script has been applied out of order. What configuration might be responsible?

    • Aspring.flyway.baseline-on-migrate set to true
    • Bspring.flyway.out-of-order set to true
    • Cspring.flyway.locations set incorrectly
    • Dspring.flyway.enabled set to false
  4. 4.Why should migration scripts be idempotent where possible?

    • ATo avoid database locks during migration
    • BTo prevent errors when re-running scripts
    • CTo ensure scripts are only applied once
    • DTo allow automatic rollback on failure
  5. 5.A new migration script fails during deployment. What is a recommended practice to avoid such issues?

    • ATest migrations on a copy of production data
    • BUse ORM abstractions in migration scripts
    • CRun migrations manually to catch errors
    • DModify the script directly in production
  6. 6.What is the purpose of the flyway_schema_history table?

    • ATo manage database connections for Flyway
    • BTo track which migration scripts have been applied
    • CTo log errors encountered during migrations
    • DTo store the SQL scripts for future reference
  7. 7.A developer believes Flyway auto-generates migration scripts. What is the correct understanding?

    • ADevelopers must write migration scripts manually
    • BMigration scripts are unnecessary with Flyway
    • CScripts are generated from JPA entity changes
    • DFlyway generates scripts based on database changes
  8. 8.What happens if you set spring.flyway.baseline-on-migrate to true in an existing database with no Flyway history?

    • AIt allows Flyway to baseline the database, avoiding errors
    • BIt causes Flyway to reapply all migrations
    • CIt disables Flyway migrations entirely
    • DIt requires all scripts to be re-written