rolang / dumbo

Simple database migration tool for Postgres with skunk on JVM and Native
MIT License
26 stars 3 forks source link

Add support for repeatable migrations #29

Closed rolang closed 1 month ago

rolang commented 6 months ago

Flyway repeatable migrations

Repeatable migrations have a description and a checksum, but no version. Instead of being run just once, they are (re-)applied every time their checksum changes.

This is very useful for managing database objects whose definition can then simply be maintained in a single file in version control. They are typically used for

  • (Re-)creating views/procedures/functions/packages/...
  • Bulk reference data reinserts

Within a single migration run, repeatable migrations are always applied last, after all pending versioned migrations have been executed. Repeatable migrations are applied in the order of their description.

It is your responsibility to ensure the same repeatable migration can be applied multiple times. This usually involves making use of CREATE OR REPLACE clauses in your DDL statements.

Naming:

image