Skip to content

Failed version is recorded into the DatabaseVersion collection #20

@safor

Description

@safor

In case of a migration failure, a corresponding version is being recorded into the DatabaseVersion collection. So, next time migrations are being run the failed one is not being executed. Is it a bug or feature?

In an example below the first run will execute the RedMigration and fail, the second run will skip the RedMigration and execute the GreenMigraion.

    public class RedMigration : Migration
    {
        public RedMigration() : base("1.0.0") { }
        public override void Update() {
            throw new System.Exception("Testing migrations rollback");
        }
    }

    public class GreenMigration : Migration
    {
        public GreenMigration() : base("1.0.1") { }
        public override void Update() {
            // empty
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions