Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flyway always execute repeatable migrations

Is it possible to execute repeatable migrations in flyway even when the checksum is the same? The problem I am facing is having a view which extends another table with additional rows and the view doesn't get updated automatically.

An example here:

R__person_view.sql

CREATE OR REPLACE VIEW person_view AS 
    SELECT p.*, e.name FROM person p, entity e
    WHERE /* not relevant here ... */;

If this migration is executed at first it will work fine. If I add another migration, where I modify the table person, the changes are not adapted, because the view migration checksum did not change.

like image 340
Ian Fako Avatar asked Jun 08 '26 14:06

Ian Fako


1 Answers

Yes, from Flyway 6.3.0 it has been possible to have repeatable migrations run each time using the timestamp placeholder in a comment, ensuring that Flyway sees this as being changed afresh each time. For example:

R__UtilityProcedures.sql
-- ${flyway:timestamp}
create or replace procedure my_important_proc
like image 114
David Atkinson Avatar answered Jun 10 '26 03:06

David Atkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!