New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Callbacks - more than one .sql file per event #1315
Comments
+1 on this. |
Could we make the callback names only be prefixes instead?
|
There is one additional benefit of having more that one hook: |
It would be nice to have callbacks before and after a specific migration only. This could be used to insert test data after schema creation to allow that the next migrations could be run with existing data. For example, having the sql scripts for the migration in an |
@tinproject Multiple locations combined with dotted version numbers (7.1, 8.1, ...) already let you achieve this today. |
@axelfontaine could you explain a little bit more? |
This has now been implemented. Multiple SQL callbacks for the same event are now allowed. They then must have a description and are executed in the order of their description. Example: |
What version of Flyway are you using?
4.0.1
What database are you using (type & version)?
Oracle 11.2
What operating system are you using?
Windows 7 & RHEL
Feature Request
At present, a Sql Callback can execute only one .sql file eg afterMigrate.sql. This file can't import code from another .sql files or 'call' another .sql file. I would like to execute multiple .sql files in a callback.
At present, I use Oracle SqlPlus to execute a list of files after migration but I would prefer if I could do this with Flyway.
Suggested implementation:
Have flyway scan for callback files named something like this: afterMigrate.sql.list
Execute all the .sql files listed.
The text was updated successfully, but these errors were encountered: