I have a database with views and stored procedures that often need to be modified. I would like to be able to store these views in another directory, and include the sql code when I write a migration. Basically, the dir structure would be
views/
my_view.sql
functions/
my_func.sql
sql/
V1__add_view.sql
And V1__add_view.sql would be something like
\i views/my_view.sql
Which will currently work in psql, but not in flyway migrations. The advantage of this is that when we wanted to make a change, we could modify the view in place, and include it in the next migration. It would also just eliminate a vast amount of copy-pasting in view migrations.
Is there any way to include external SQL scripts in a flyway migration?