I've seen posts about FlyWay handling multiple databases but it all seems like it is for databases that are independent. As I understand it, FlyWay can only handle one database per instance so creating/cleaning database schemas are completely independent.
Multiple datasources migrations using Flyway in a Spring Boot application
Our problem probably stems from bad db design but it is what it is and it won't be changed quickly. As for background, this is a C# old school application with MSSql DB and we're currently just using the FlyWay command line for evaluation purposes.
The DB(s) is set up like this.
- AppDB
- AppLogDB
- AppAuditDB
- AppArchiveDB
- ...
I have examples where AppDB has views/procedures/etc that reference the other tables. There are also cases where other DBs access AppDB (IE ArchiveDB stored procedures will pull from AppDB).
With this dependency between the different databases, is there anyway FlyWay can handle the migration/clean in the order required? For example
If I have this order of scripts
- AppDB
- V1__Create_table
- V2__Create_proc_pointing_to_ArchiveDB
- ArchiveDB
- V1__Create_table
- V2__Create_proc_pointing_to_AppDb
How could this be re-done to handle it more like this
- AppDB, ArchiveDB
- V1__AppDB_Create_table
- V2__ArchiveDB_Create_table
- V3__AppDB_Create_proc_pointing_to_ArchiveDB
- V4__ArchiveDB_Create_proc_pointing_to_AppDb