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
DataStack
will try to migrate allStorageInterface
s 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
DataStack
will try to migrate allStorageInterface
s 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
DataStack
will try to migrate allStorageInterface
s added to itself to this version, following the version steps provided by themigrationChain
.Declaration
Swift
public let migrationChain: MigrationChain
-
Convenience initializer for a
SchemaHistory
created from a single xcdatamodeld file.Declaration
Swift
public convenience init(_ xcodeDataModeld: (allSchema: [XcodeDataModelSchema], currentModelVersion: ModelVersion), migrationChain: MigrationChain = nil)
Parameters
xcodeDataModeld
a tuple returned from the
XcodeDataModelSchema.from(modelName:bundle:migrationChain:)
method.migrationChain
the
MigrationChain
that 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
SchemaHistory
with a list ofDynamicSchema
and aMigrationChain
to describe the order of progressive migrations.Declaration
Swift
public convenience init(_ schema: DynamicSchema, _ otherSchema: DynamicSchema..., migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)
Parameters
schema
a
DynamicSchema
that represents a model versionotherSchema
a list of
DynamicSchema
that represent other model versionsmigrationChain
the
MigrationChain
that 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.exactCurrentModelVersion
an optional string to explicitly select the current model version string. This is useful if the
DataStack
should 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
SchemaHistory
with a list ofDynamicSchema
and aMigrationChain
to describe the order of progressive migrations.Declaration
Swift
public required init(allSchema: [DynamicSchema], migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)
Parameters
allSchema
a list of
DynamicSchema
that represent model versionsmigrationChain
the
MigrationChain
that 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.exactCurrentModelVersion
an optional string to explicitly select the current model version string. This is useful if the
DataStack
should 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 }