SchemaHistory
public final class SchemaHistory : ExpressibleByArrayLiteral
extension SchemaHistory: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
The SchemaHistory encapsulates multiple DynamicSchema across multiple model versions. It contains all model history and is used by the DataStack to
-
The version string for the current model version. The
DataStackwill try to migrate allStorageInterfaces added to itself to this version, following the version steps provided by themigrationChain.Declaration
Swift
public let currentModelVersion: ModelVersion -
The schema for the current model version. The
DataStackwill try to migrate allStorageInterfaces added to itself to this version, following the version steps provided by themigrationChain.Declaration
Swift
public var currentSchema: DynamicSchema { get } -
The version string for the current model version. The
DataStackwill try to migrate allStorageInterfaces added to itself to this version, following the version steps provided by themigrationChain.Declaration
Swift
public let migrationChain: MigrationChain -
Convenience initializer for a
SchemaHistorycreated from a single xcdatamodeld file.Declaration
Swift
public convenience init(_ xcodeDataModeld: (allSchema: [XcodeDataModelSchema], currentModelVersion: ModelVersion), migrationChain: MigrationChain = nil)Parameters
xcodeDataModelda tuple returned from the
XcodeDataModelSchema.from(modelName:bundle:migrationChain:)method.migrationChainthe
MigrationChainthat indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack. -
Initializes a
SchemaHistorywith a list ofDynamicSchemaand aMigrationChainto describe the order of progressive migrations.Declaration
Swift
public convenience init(_ schema: DynamicSchema, _ otherSchema: DynamicSchema..., migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)Parameters
schemaa
DynamicSchemathat represents a model versionotherSchemaa list of
DynamicSchemathat represent other model versionsmigrationChainthe
MigrationChainthat indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.exactCurrentModelVersionan optional string to explicitly select the current model version string. This is useful if the
DataStackshould load a non-latest model version (usually to prepare data before migration). If not provided, the current model version will be computed from theMigrationChain. -
Initializes a
SchemaHistorywith a list ofDynamicSchemaand aMigrationChainto describe the order of progressive migrations.Declaration
Swift
public required init(allSchema: [DynamicSchema], migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)Parameters
allSchemaa list of
DynamicSchemathat represent model versionsmigrationChainthe
MigrationChainthat indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.exactCurrentModelVersionan optional string to explicitly select the current model version string. This is useful if the
DataStackshould load a non-latest model version (usually to prepare data before migration). If not provided, the current model version will be computed from theMigrationChain.
-
Declaration
Swift
public convenience init(arrayLiteral elements: DynamicSchema...)
-
Declaration
Swift
public var debugDescription: String { get }
View on GitHub
SchemaHistory Class Reference