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

Activity

linked a pull request that will close this issue on Apr 28, 2025
Dosenpfand

Dosenpfand commented on Apr 28, 2025

@Dosenpfand
Author

I had a bit of time so I tried to add this feature and opened #3846 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Dosenpfand

      Issue actions

        Skipping/Faking Migrations · Issue #3841 · launchbadge/sqlx