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

Add migration listener #87

Open
gastonlagaf opened this issue Jan 29, 2024 · 0 comments
Open

Add migration listener #87

gastonlagaf opened this issue Jan 29, 2024 · 0 comments

Comments

@gastonlagaf
Copy link

Schema migration in practice frequently includes not only schema migration, but also data changes. For instance in case of creating of additional table to existing one for new select support, apart from creation of new table, we also need to fill it with data from primary table.

What if, hypothetically, tool could accept some implementations of interface with two methods:

  • getVersion, which specs, after which schema migration script it should be executed
  • apply, data migration execution scenario itself

Eventually, on script execution, tool will get data migration, assigned to script and invoke it and after that, migration is considered as executed successfully

Feature request is based on personal implementation of data migration, but it is executed after schema migration with it's own tables, containing migrations and leaders information. In practice, if you use spring data repositories in data migration code, you should support old migrations, as models change alongside with schema, which leads to compilation problems. It is easier to delete them later. Alternatively, you can operate with cqlTemplate, playing around with non-mapped result set, in this case you write code only once, but code itself is more complex. In any case, with such proposal, user is not forced to some specific approach, it is up to him to decide, what and how to operate on schema migration #X .

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