Skip to content

Skipping/Faking Migrations #3841

Open
@Dosenpfand

Description

@Dosenpfand

I have found these related issues/pull requests

Relates to #3706

Description

In my use case it would be helpful to be able to skip/fake migrations, i.e. mark migrations as done but not actually execute the SQL statements of the migration.

I have a system with existing migrations and deployments at different versions. I want to port the migrations to sqlx, and would therefore need to fake/skip already applied migrations, using my current migration method.

Prefered solution

I already hacked together a PoC for SQLite (duplicated code, no tests, etc.) in Dosenpfand/sqlx/migrations-skip. If there is interest in this I would be willing to prepare a proper implementation and open a PR.

An ideal solution would allow skipping migrations via sqlx::migrate::Migrator as well as via the cli e.g. sqlx migrate skip [OPTIONS]

Is this a breaking change? Why or why not?

Not necessarily

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