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

Feature proposal: Add method to check if migrations are required #359

Open
iceman91176 opened this issue Sep 20, 2024 · 0 comments
Open

Comments

@iceman91176
Copy link

Why ?

When performing re-indexing with our-evolution-scripts we have to be sure that no write-access happens while reindexing (because we write to the index-alias, which still points to the old index) Only after successful re-indexing we change the alias to new new index. Now it is save to start writing again.

To accomplish this we have added a functionality for our multi-instance environment that stops all writing on all instances before executing the evolution, and starts it again after the evolution has been completed. The schema evolutinon is triggered on application start.

But we have to do this even if no evolution will be performed because all scripts have been run already. It would be great to be able to detect if any migration is necessary - and if so perform some action, or just do nothing.

Proposal

I've seen that the current MigrationServiceImpl has a getPendingScriptsToBeExecuted Method that could help here

List<ParsedMigrationScript> getPendingScriptsToBeExecuted(Collection<ParsedMigrationScript> migrationScripts) {

The most simple solution would be to expose a migrationsRequired method that returns true or false by checking the result of getPendingScriptsToBeExecuted

If you accept the general idea and the implementation proposal, I would be happy to provide a PR for this :)

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

1 participant