MigrationResult

public enum MigrationResult : Hashable

The MigrationResult indicates the result of a migration. The MigrationResult can be treated as a boolean:

CoreStore.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in
    switch result {
    case .success(let migrationSteps):
        // ...
    case .failure(let error):
        // ...
    }
}
  • MigrationResult.success indicates either the migration succeeded, or there were no migrations needed. The associated value is an array of MigrationTypes reflecting the migration steps completed.

    Declaration

    Swift

    case success([MigrationType])
  • SaveResult.failure indicates that the migration failed. The associated object for this value is the a CoreStoreError enum value.

    Declaration

    Swift

    case failure(CoreStoreError)
  • Returns true if the result indicates .success, false if the result is .failure.

    Declaration

    Swift

    public var isSuccess: Bool { get }
  • Declaration

    Swift

    public var debugDescription: String { get }