This article demonstrates using PowerShell-based tokenization to compare two SQL migration files. It ignores non-functional changes like comments or formatting and pinpoints the first meaningful change in SQL logic, providing detailed feedback on its location and nature. Read more
This article provides a scripted SQL tokenizer script that quickly verifies whether a Flyway validation error is a real cause for concern, due to retrospective metadata changes, or just the result of a developer valiantly adding formatting and documentation to improve the code. If the changes are purely cosmetic, we can safely run Flyway repair to resume normal migrations. Read more
Extracting and importing data for development and testing is made trickier due to issues such as constraints, dependencies, and special data types. This article introduces a cross-RDBMS solution with JSON for data storage and PowerShell cmdlets that use ODBC to help automate extraction and import, and JSON Schema for validation. Just provide a DSN, and you’re good to go! Read more
Environment Variables make interactive use of Flyway much easier, and they are essential when developing callback scripts. This article explains the range of configuration details you can provide and how, and demos a PowerShell script to auto-convert the parameter values stored in Flyway .conf files into environment variables. Read more
Database forking allows teams to multi-task, working on different strands of development in parallel. It also allows them to manage several 'variants' of a production database, such as for SaaS applications with client-specific schema requirements. This article explains how Flyway supports and simplifies database forking, via use of Flyway's locations, baseline migrations and by mapping Flyway projects to schemas. Read more
This article demonstrates how to use the rgclone CLI in Redgate Test Data Manager to automatically save each new version of a database created by Flyway as a data container revision, tracking which Flyway version maps to which container revision. We can then, from a single data container, load any version of the database during test setup, as well as quickly 'reset' a container during test teardown. Read more
Redgate Test Data Manager allows developers to save each new version of a database as a data container revision. After making local development changes to the container, or running tests, they can instantly reset it to its starting revision. They can also load any previous revision and can even 'graduate' a revision to an image, providing a new baseline for ongoing team development. These techniques are especially effective when used in conjunction with Flyway, which automatically tracks the version of every copy of the database. Read more
Maintaining a version of a database opens a lot of possibilities, especially if an automated process can easily grab the current version, at runtime. You might, for example, have a routine that is only appropriate after a particular version. It is also very handy to be able to associate entries in an event log or bug report with the database version. The article describes various ways to get the current Flyway schema version from Flyway, and how to get it using SQL, in SQL Server, MySQL, PostgreSQL and SQLite. Read more
Data containers can be created, destroyed and reset remarkably quickly, making them very effective for test-driven database development. Each time we reset a data container, it will have the same host, but both the port and password will be different. This article demonstrates how we can use simple PowerShell automation to smooth the process of dealing with ephemeral connection details in our IDEs and command line tasks. Read more
This article discusses Flyway's transition from CONF to TOML configuration files. It highlights the advantages of TOML, such as improved readability, flexibility in managing complex database configurations, and support for specifying multiple database environments. It also discusses a few of the differences to be aware of when switching existing Flyway projects to the new config system. Read more