MigrationType

public enum MigrationType : Hashable
extension MigrationType: CoreStoreDebugStringConvertible

The MigrationType specifies the type of migration required for a store.

  • Indicates that the persistent store matches the latest model version and no migration is needed

    Declaration

    Swift

    case none(version: ModelVersion)
  • Indicates that the persistent store does not match the latest model version but Core Data can infer the mapping model, so a lightweight migration is needed

    Declaration

    Swift

    case lightweight(sourceVersion: ModelVersion, destinationVersion: ModelVersion)
  • Indicates that the persistent store does not match the latest model version and Core Data could not infer a mapping model, so a custom migration is needed

    Declaration

    Swift

    case heavyweight(sourceVersion: ModelVersion, destinationVersion: ModelVersion)
  • Returns the source model version for the migration type. If no migration is required, sourceVersion will be equal to the destinationVersion.

    Declaration

    Swift

    public var sourceVersion: ModelVersion { get }
  • Returns the destination model version for the migration type. If no migration is required, destinationVersion will be equal to the sourceVersion.

    Declaration

    Swift

    public var destinationVersion: ModelVersion { get }
  • Returns true if the MigrationType is a lightweight migration. Used as syntactic sugar.

    Declaration

    Swift

    public var isLightweightMigration: Bool { get }
  • Returns true if the MigrationType is a heavyweight migration. Used as syntactic sugar.

    Declaration

    Swift

    public var isHeavyweightMigration: Bool { get }
  • Returns true if the MigrationType is either a lightweight or a heavyweight migration. Returns false if no migrations specified.

    Declaration

    Swift

    public var hasMigration: Bool { get }

Equatable

  • Declaration

    Swift

    public static func == (lhs: MigrationType, rhs: MigrationType) -> Bool

Hashable

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)

CustomDebugStringConvertible

  • Declaration

    Swift

    public var debugDescription: String { get }