Flyway upgrade vs. transition to online schema migration, etc

581 views Asked by At

Our main project has been using a now-very-old Flyway version since inception. (v3.2.1)

  • Flyway has made loads of improvements over the years, and v6+ appears to contain many interesting features for our MySQL schema.
  • Attempting the supported upgrade path, I ran into a few problems--e.g. our .sql migrations refuse to migrate from start to finish; Flyway v3.2.1 considers all our SQL migration valid, but v4+ chokes on some odd comment syntax. Naturally, file fixups to get migrate working will produce different check sums, which is an obstacle to safe upgrade. I'm well aware of the schema table name change in v5; that's not insurmountable.
  • I'm also eyeing Liquibase vs. and online schema migration tools; FB, Percona and GitHub's OST (gh-ost) look interesting, but we use foreign keys, and we'd need more replicas, so that may not be in the cards for us right now.

For now, I'm interested in a new baseline w/ Flyway v7 beta or switching tools. If you deploy SaaS on k8s and have any generic advice--I'll take it, but I'm specifically interested in one thing:

How have folks overcome the issue where newer versions of Flyway no longer accept existing SQL migrations. Or, has anyone "given up" and just created a new baseline, rather than doing the long upgrade path? (or, switched from Flyway to another tool with similar merits)

2

There are 2 answers

0
hagemt On

There are at least two problems here, with many moving parts:

  1. Dealing with the tooling's constraints, and how to deal with Flyway 3->7+ (follow the tool's doc)
  2. How to incorporate large prod SQL migrations in general, which is too general a problem to cover here.

If anyone has better (less general) advice on the first, I'd love to hear it.

Re: the second, we're looking to our infra and deployment from off-the-shelf tools.

Most projects I've worked on have been Spring based. (large ecosystem, even without the k8s bits)

0
Ningjing Chen On

You may give a shot to bytebase (bytebase.com).

  • Web-Based
  • Open-Source
  • Can do MySQL schema migration triggered by GitHub/GitLab with full history