Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base version for applying change #11

Open
ghenadiibatalski opened this issue Nov 4, 2019 · 1 comment
Open

Base version for applying change #11

ghenadiibatalski opened this issue Nov 4, 2019 · 1 comment

Comments

@ghenadiibatalski
Copy link

Hello Roman, this is less an issue but more a question.

  1. Do you create and update something like DATABASECHANGELOG collection with already applied patches to prevent failures or damages by accidentially repeating of not idempotent changesets?
  2. Is it possible to declare the base state (version/timestamp from the above DATABASECHANGELOG), for what a patch/changeset may be applied?

Regards, Gena

@coldze
Copy link
Owner

coldze commented Nov 5, 2019

Hi Gena,

Sorry for delay, I'm on vacations right now :)

  1. Yes, correct - there is a collection named mongol_migrations_3710611845fe4161b74d2ec5eafe9124. It contains list of changes applied + hash of that change.
  2. This tool relies on a sequence of changes, declared in changelog-file - if there is a change (migration) inserted in the middle between already applied migration, it will fail with corresponding message (format: Applied changeSet-set with ID %v after not-applied changes).
    So, directly answering your question - no, right now here is no ability to reference/declare a dependency on another migration or make some kind of tag/versioning.
    Actually, it seems to be a good idea for, at least, removing "old" migrations, ie flattening list of migrations + it will add an extra check for DB integrity before applying migrations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants