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 thedestinationVersion
.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 thesourceVersion
.Declaration
Swift
public var destinationVersion: ModelVersion { get }
-
Returns
true
if theMigrationType
is a lightweight migration. Used as syntactic sugar.Declaration
Swift
public var isLightweightMigration: Bool { get }
-
Returns
true
if theMigrationType
is a heavyweight migration. Used as syntactic sugar.Declaration
Swift
public var isHeavyweightMigration: Bool { get }
-
Returns
true
if theMigrationType
is either a lightweight or a heavyweight migration. Returnsfalse
if no migrations specified.Declaration
Swift
public var hasMigration: Bool { get }
-
Declaration
Swift
public static func == (lhs: MigrationType, rhs: MigrationType) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }