Skip to content

Releases: mergesort/Monarch

Swift…ier migrations

07 Nov 21:25
Compare
Choose a tag to compare

This release adds a teeny internal caching layer, due issues with how slowly UserDefaults can update.

This provides stability for a use case where you wish to mark some migrations as run, followed by running migrations. In the scenario below, you may have run all the migrations you marked as complete, because UserDefaults does not update it's state fast enough.

MigrationRunner.markMigrationAsCompleted(withID: "1")
MigrationRunner.markMigrationAsCompleted(withID: "2")
MigrationRunner.markMigrationAsCompleted(withID: "3")

let activeMigrations = MigrationGroup {
    MigrationWithID1()
    MigrationWithID2()
    MigrationWithID3()
    MigrationWithID4()
}

// This may run 1, 2, 3, and 4, because `UserDefaults` does not update fast enough,
// and has not cached 1, 2, and 3 being marked as completed.
try await MigrationRunner.runMigrations(activeMigrations)

Note

You may have noticed that there is no release for version 1.0.1, that's because of an issue that occurred with Github's Releases caching. The code in this version is identical to what previously was 1.0.1.

Initial Migration

07 Nov 01:05
02dfe68
Compare
Choose a tag to compare
1.0.0

Updating README example