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

Repeatable migrations #211

Open
dlight opened this issue Jan 25, 2022 · 1 comment
Open

Repeatable migrations #211

dlight opened this issue Jan 25, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dlight
Copy link

dlight commented Jan 25, 2022

Flyway features repeatable migrations for defining objects in the db that can simply be tracked as is from the source code (typically because they are stateless, like CREATE OR REPLACE ...). This pattern is a good way to manage functions, stored procedures, etc: it enables having the previous version of the function/stored procedure/etc on Git history, while keeping only the last version checked out, like most source code, making it easier to track changes within a single function.

This question on stack overflow, linking to this Flyway github issue, and this other issue motivates it further.

@jxs jxs added enhancement New feature or request help wanted Extra attention is needed labels Feb 8, 2022
@jakajancar
Copy link
Contributor

One potential danger with this is if such views/functions/... are used in the migrations themselves. This can lead to making the migrations historically changeable, and the end state depend on timing of deploys.

For example, depending if you if you apply:

  • Scenario A:
    1. Code v10: Migration v10, functions/views/... v10
    2. Code v11: Migration v11, functions/views/... v11
  • Scenario B:
    1. Code v11: Migration v10 & v11, functions v11

You will get different results, because in scenario B migration v10 did not have access to DB functions/views/... from v10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants