Skip to content

Support for repeatable migrations #2784

Open
@salah3x

Description

@salah3x

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions