Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating Stored Procedures with Flyway

How should procedural database code like stored procedures be managed with a database migration tool like Flyway?

Unlike DDL I would not want to see changes to a stored procedure stored within multiple database migration files. How can procedural code be managed within a single file under source control, but also take advantage of database migrations with a tool like Flyway?

like image 440
Nick Allen Avatar asked Apr 04 '13 23:04

Nick Allen


1 Answers

There is no special construct in the framework to deal with this. Mainly because I haven't figured out a way to do this that pleases me.

Update: Repeatable scripts are now fully supported as of Flyway 4.0. See https://flywaydb.org/documentation/migrations#repeatable-migrations

like image 185
Axel Fontaine Avatar answered Sep 18 '22 14:09

Axel Fontaine