Skip to content

Allow specifying target version when validating migrations #1257

@haines

Description

@haines

We use the (*Migrator[TTx]).Validate to check on startup if the database migrations have been applied.

We want to roll out River Pro v0.24.0, which means we want to stop at migration v6 for the pro line.

We can pass a MigrateOpts to the Migrate method to actually perform the migration, but there doesn't seem to be a way to do the same when validating, so presumably we're going to get an error because v7 hasn't been applied yet.

As a workaround I think we can compare the results of AllVersions and ExistingVersions but it is a bit of a pain having to reimplement the validation logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions