![]() Integrating Flyway into an existing project is simple, as there is little configuration required for setup. This was particularly important for our product since we were iterating rapidly and needed the ability to deploy features quickly and confidently in order to gather user feedback. The biggest advantage of using a migration tool is that it ensures software releases are always delivered with the matching state of the database. Migrations that are available, but not applied, are called pending migrations. Each time Flyway scans the file system of the application for migration, it queries the schema_version table to see what version the database is on and can upgrade the database accordingly. The migrations are sorted based on their version number and executed in order.Īfter each migration gets applied, the schema_version table gets updated accordingly. This table is used to keep track of the state of the database. The very first time it runs with the first migration, it creates a table called s chema_version with several columns including version, description, script, and checksum. When there’s a need to change the schema of the database, a developer adds a SQL script, usually in the db/migrations directory.Īfter pointing Flyway to a database, it begins scanning the filesystem of the application for migrations. Repeatable migrations have a description and a checksum and are reapplied every time their checksum changes. Versioned migrations have a version, description, and a checksum and are applied in order exactly once. In Flyway, Migrations have two types they can either be versioned or repeatable, versioned being the most common. Overview of FlywayĬhanges made to the database by Flyway are known as Migrations. ![]() This can prevent a developer from running into a column not found error, for example. Migration tools add assurance that an application will run with the current state of the database. They allow developers to recreate a database from scratch, which is valuable when creating a new environment. Tools such as Flyway can prevent database schema mismatch when working with multiple environments, such as dev, test, and prod, or when switching branches. Migrations are managed incrementally and are reversible. Schema migrations add versioning capabilities to a database. Techniques to allow a database design to develop as an application evolves allowed engineers to iterate on software more efficiently.ĭuring this time, database migration tools rose in popularity. Why did we need a schema migration tool? Benefits of Schema Migrations and ToolingsĪs Agile methodologies progressed and became widely adopted in the early 2000s, the need for schema migration tools became greater. While we looked at several other schema migration tools, this one seemed best suited for our particular use case. ![]() Flyway is an open source database migration tool enabling developers to apply version control practices to their databases. The one we settled on for our database was Flyway. We worked cross-collaboratively throughout the first five months of prototyping to define a database schema that would meet our users’ analytical needs.ĭuring this time, My tech lead and I decided to explore schema migration tools to ease our development as we designed our database. The team included two software engineers, four data analysts and scientists, and a product manager. My team and I recently built a data management tool in the form of a web app for our bank’s relationship managers and analysts. As a software engineer at Capital One, I develop new applications for our commercial bank.
0 Comments
Leave a Reply. |