Spring Boot and MySQL here. Trying to get my Spring Boot app to use Liquibase for my DB migrations and see in the docs that Spring Boot has built-in support for Liquibase.
However after reading those docs, I'm left with several related concerns:
- What is the fundamental purpose of the
db/changelog/db.changelog-master.yaml
file? Is it to store Liquibase configurations (that dictate how Liquibase behaves), or is that where I'm supposed to put the actual, sequential SQL changes (the "migrations") themselves?- Ideally I'd like to have a
src/main/resources/migrations
directory and store my migration changes as individual SQL files, like so: src/main/resources/migrations/001-schema.sql
src/main/resources/migrations/002-init.sql
src/main/resources/migrations/003-changing-account-types.sql
- ...etc. Is it possible to configure Liquibase to do this via Spring Boot?
- Ideally I'd like to have a
- When will Spring Boot run these Liquibase migrations? At app startup? What if the Spring Boot app actually runs on a cluster of nodes (say 5 nodes behind a load-balanced URL)? Will Spring Boot run Liquibase run 5 times, once on each node? Or does it somehow sense that one node is the "master migrator", etc.?