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,
sourceVersionwill 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,
destinationVersionwill be equal to thesourceVersion.Declaration
Swift
public var destinationVersion: ModelVersion { get } -
Returns
trueif theMigrationTypeis a lightweight migration. Used as syntactic sugar.Declaration
Swift
public var isLightweightMigration: Bool { get } -
Returns
trueif theMigrationTypeis a heavyweight migration. Used as syntactic sugar.Declaration
Swift
public var isHeavyweightMigration: Bool { get } -
Returns
trueif theMigrationTypeis either a lightweight or a heavyweight migration. Returnsfalseif 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 }
View on GitHub
MigrationType Enumeration Reference