Span migration of stored procedures

How do I handle database procedural code, such as stored procedures, using a database migration tool such as Flyway?

Unlike DDL, I would not want to see changes in the stored procedure stored in several database migration files. How to process procedural code in a single file under source control, but also use database migration with a tool like Flyway?

+6
source share
2 answers

There is no special design in this structure to solve this problem. Mainly because I did not understand the way to do this, which I like.

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

+6
source

What are we doing:

  • Have a complete CREATE OR REPLACE Flyway script for stored procedures whenever they change.
  • Store each stored procedure in a separate area in the source control to track changes and differences are computable.

Not a great solution and pain to remember every time, but it overcomes some of the limitations of this tool.

0
source

All Articles