๐ Learning and exploring Flyway, the Java-based database migration tool.
Database Migrations Made Easy.
This codebase is my way of learning Flyway and building a corpus of runnable reference code.
NOTE: This project was developed on macOS. It is for my own personal use.
This repository illustrates different concepts, patterns and examples via standalone subprojects. Each sub-project is completely independent of the others and do not depend on the root project. This standalone sub-project constraint forces the subprojects to be complete and maximizes the reader's chances of successfully running, understanding, and re-using the code.
The subprojects include:
A simple Gradle and Java project that builds a database schema using Flyway.
See the README in basic/.
An intermediate Flyway example project.
See the README in advanced/.
General clean-ups, TODOs and things I wish to implement for this project:
- DONE Consider creating a
basic/
and anadvanced/
subproject. I want to keep the basic stuff optimized for getting up running. Inadvanced/
I want to do stuff like create a custom Java-based migration, andy maybe explore idempotent things like repeatable migrations. And other features I'm not considering.- DONE Create a
basic/
subproject.
- DONE Create a
- Flyway documentation
- Flyway docs: "SQL-based migrations"
Migrations are most commonly written in SQL. This makes it easy to get started and leverage any existing scripts, tools and skills. It gives you access to the full set of capabilities of your database and eliminates the need to understand any intermediate translation layer.
- This is a pragmatic approach in my opinion. I compare it to Liquibase where it's common (recommended?) to define migrations in the Liquibase language (well, config). I eventually settled on SQL-based migrations in Liquibase after some time. I think this is "the way".
- The Flyway docs are great!