Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using flyway to support multiple database instances with various data

My team currently has several beta customers using our product. The current method of upgrading a customer's database to the latest version consists of, re-initializing the database, and re-creating the customers configuration by hand, which isn't a lot, but is certainly tedious and will change as we implement some kind of migration strategy.

My question is, is it possible to use flyway (or some other tool) to manage database schema migrations of all instances of our product, yet retain independent instance data? What is the best approach to this kind of problem.

like image 258
beta-brad Avatar asked Oct 06 '22 05:10

beta-brad


1 Answers

Yes, you can use Flyway for this.

You can place the customer-specific reference data in a separate location per customer.

You can then configure flyway.locations like this:

Customer A: flyway.locations=scripts/ddl,scripts/data/customer_a

Customer B: flyway.locations=scripts/ddl,scripts/data/customer_b

like image 59
Axel Fontaine Avatar answered Oct 10 '22 04:10

Axel Fontaine