migrate-mongo icon indicating copy to clipboard operation
migrate-mongo copied to clipboard

Support of repeatable migrations, that are always executed, if checksum is changed

Open ddienhardt opened this issue 5 years ago • 1 comments

Despite standard migrations we have some data in the database that serve as a complex configuration. We do not want to track changes to this configuration as sequence of migrations in our repository. At the moment we delete and re-create this data during any deployment.

As user of the migrate-mongo, I would like to add repeatable migrations, that are executed as soon as there checksum has changed, regardless of the database version, so that I have the actual state of this data reflected in the database and the repository. The execution of baseline should be ordered by filename.

Describe alternatives you've considered Using a wrapper around migrate-mongo which execute the baseline scripts at the beginning and then calls the migrate-mongo api, but therefor i would need to duplicate the db configuration.

Additional context there’s a similar functionality in flyway: https://flywaydb.org/documentation/migrations#repeatable-migrations

ddienhardt avatar Nov 22 '19 10:11 ddienhardt

Repeatable migrations are highly beneficial, but I would denote them separately, like flyway, and not tie their execution to if the checksum of the file has changed. As an example, performing common maintenance routines after large migrations or data loads.

SailingYYC avatar Aug 12 '20 21:08 SailingYYC