Reputation: 2017
Im using a MySQL database and playing around with flyway command line tool (http://flywaydb.org/). Ideally I'd like to see separation between the schema migration changes and stored procs/functions i.e.
src/db/V01__init.sql
src/db/procs/01_util.sql
src/db/procs/02_time.sql
...
Ive found the afterMigrate.sql file which gets triggered at the completion of the migrate command from the command line. But cannot see how I would include all the 2 stored proc files I have.
I tried putting this into the afterMigrate.sql
SOURCE 'procs/01_util.sql';
SOURCE 'procs/02_time.sql';
However seems to result in an SQL Syntax error.
Is there some way i can include the stored proc files inside the afterMigrate file short of defining it all inside one file?
Upvotes: 0
Views: 843
Reputation: 35169
Short answer: no, with 3.X you have to put them into one file or implement your own call back in Java.
For 4.0, we will indroduce first class support for these types of repeatable scripts that should make this much easier.
Upvotes: 1