I have an existing database that I am putting into source control and going to be using Flyway to handle migrations.
Rightly or wrongly, some of the Views, Functions and Stored Procedures have dependencies on each other.
My original file structure follows this format;
R__SP__StoredProcOne
R__SP__StoredProcTwo
R__UDF__UserDefinedFunctionOne
R__UDF__UserDefinedFunctionTwo
R__V__ViewOne
R__V__ViewTwo
An example of my issue is that R__UDF__UserDefinedFunctionOne has a dependency on R__UDF__UserDefinedFunctionTwo. But due to their names, the R__UDF__UserDefinedFunctionOne function migrates first, causing Flyway to throw an error saying it can't be found.
I have mitigated this issue by introducing additional numbering, to force the migration order.
But I feel like there should be a better way of doing this or a setting in Flyway that will allow it to migrate regardless of the file ordering.
I have tried the -mixed=true and -group=true parameters but to no avail.