A development team deploys application code through an automated CI/CD pipeline, but database schema changes are still applied by hand, and environments regularly drift apart. The team wants schema changes to move through the same pipeline. What should the DBA set up?
Select an answer to reveal the explanation.
Short Explanation
Think of migration scripts as numbered recipe cards: every kitchen follows them in the same order, so every dish comes out the same. Your pipeline reads the cards from version control and applies them environment by environment. Letting the ORM rebuild production tables on startup is like tossing out the pantry to restock it.
Full Explanation
Bringing database changes into CI/CD means expressing each schema change as a versioned migration script stored in source control alongside application code. The pipeline applies pending migrations in order to each environment, from development through test to production, records which versions have been applied,. This keeps environments consistent, provides an audit trail, and allows the same tested artifact to be promoted to production. Manual typing in each environment is the current process that causes drift; it is error-prone, unrepeatable and leaves no reliable record. Automatic schema generation that recreates tables from ORM models at startup is useful in disposable development databases, but recreating production tables risks dropping data and makes schema changes happen implicitly whenever the application starts rather than through approved deployments. Copying the development database over production would overwrite real production data with test data, which is destructive and violates basic change control. Exam caveat: migrations that alter large tables still need maintenance windows and backups; automation controls consistency, not impact, and production deployment usually retains an approval gate. Operational check: baseline the current production schema as the first migration, run all migrations against a fresh test database in the pipeline, compare resulting schemas across environments, and confirm the pipeline records the applied version.