Schema Migration Flashcards
What is Liquibase?
Liquibase is an open-source database version control and schema migration tool designed to help manage database changes across different environments.
In what format are database changes defined in Liquibase?
Database changes in Liquibase are defined using a declarative “changeset” format, often written in XML or other formats.
What does a “changelog” represent in Liquibase?
A “changelog” in Liquibase is a file or set of files that contains a history of changes made to the database.
Name a few operations that can be included in Liquibase changesets.
Operations such as creating tables, adding columns, inserting data, and more can be included in Liquibase changesets.
How does Liquibase support version control for database schemas?
Liquibase enables version control by allowing developers to store their database changes in version-controlled files along with their application code.
Which build tools can Liquibase be integrated into?
Liquibase can be integrated into build tools such as Maven and Gradle, enabling automated database schema updates as part of the build process.
What is the purpose of a “changeset” in Liquibase?
A “changeset” in Liquibase is a unique identifier for an individual database change, containing the specifics of the change (e.g., creating a table, adding a column).
Example of a Liquibase changeset in XML format:
<changeSet>
<createTable>
<column>
<constraints></constraints>
</column>
<column></column>
<!-- Additional columns or constraints can be defined here -->
</createTable>
</changeSet>
Liquibase is widely used in DevOps and Continuous Integration (CI) environments to manage and automate database schema changes along with application code changes.
What is Flyway?
Flyway is an open-source database migration tool that simplifies the process of managing and applying incremental changes to database schemas.
How does Flyway organize database migrations?
Flyway organizes database migrations as a series of versioned SQL scripts or Java-based migrations that are applied in order.
What is the purpose of a “baseline” in Flyway?
A “baseline” in Flyway is used to set a starting point for versioning an existing database, preventing the execution of earlier migrations when starting with an already existing database.
In what scenarios is Flyway commonly used?
Flyway is commonly used in scenarios involving continuous integration, continuous delivery, and managing evolving database schemas in Agile development environments.
How does Flyway handle versioning of database changes?
Flyway uses a versioning system to keep track of which migrations have been applied to a database. Each migration is uniquely identified by a version number.
Can Flyway migrations be written in different scripting languages?
Yes, Flyway supports migrations written in various scripting languages such as SQL (Structured Query Language) or Java.
What integration options does Flyway provide?
Flyway can be easily integrated into build tools such as Maven, Gradle, and others, allowing for seamless automation of database migrations.