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

Support for repeatable migrations #2784

Open
salah3x opened this issue Oct 20, 2024 · 0 comments
Open

Support for repeatable migrations #2784

salah3x opened this issue Oct 20, 2024 · 0 comments

Comments

@salah3x
Copy link

salah3x commented Oct 20, 2024

Is your feature request related to a problem? Please describe.
When updating definitions for objects such as views or functions, a new migration is required, which means we have to duplicate the definition to add the necessary modification.

Describe the solution you'd like
Have some repeatable migrations that are applied with each migration up command, something similar to Flyway's Repeatable Migrations

Let's say we have these files in the migrations folder

[timestamp1]_migration_1.sql
r_my_view_or_function.sql

Running migration up would apply migration_1 and then my_view_or_function (it can use current_timestamp as version).
We now add a new migration:

[timestamp1]_migration_1.sql
[timestamp2]_migration_2.sql
r_my_view_or_function.sql

Running migration up would skip migration_1, apply migration_2, and then re-apply my_view_or_function (with a different current_timestamp as version).

Describe alternatives you've considered
Manually executing r_my_view_or_function.sql after applying migrations by connecting to the database directly

Additional context
N/A

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