Is it OK to rename Flyway repeatable migrations?

Viewed 1310

I have set up a bunch of repeatable migrations for my project to drop (and recreate) some frequently modified database views. The package structure looks something like this:

src/main/resources
  |-db
    |-R__pets_amphibians_view.sql
    |-R__pets_birds_view.sql
    |-R__pets_mammals_view.sql
    |-R__pets_reptiles_view.sql
    |-...
    |-<versioned-migrations>

Now, what I would like to do is to split the R__pets_mammals_view.sql view up into two more specific views: e.g. R__pets_mammals_dogs_view.sql and R_pets_mammals_rodents_view.sql, respectively. This would also entail renaming/deleting the original R_pets_mammals_view.sql file.

What I would like to know is whether I can do this without messing up my schema versioning (possibly killing any hosted environments in the process)? Unfortunately, I could not find an answer to this in the Flyway docs.

P.S.: I understand that it's not a good idea to rename versioned migrations once they've been deployed to anything beyond the local environment. However, since repeatable migrations can be modified at will (and since they're executed last), I'm not sure whether they actually "count" in this context.

1 Answers
Related