Merge pull request #421 from xquezme/develop

Fix compound indexes for dynamic models
This commit is contained in:
John Estropia
2021-07-20 09:26:17 +09:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -197,7 +197,7 @@ class DynamicModelTests: BaseTestDataTestCase {
modelVersion: "V1",
entities: [
Entity<Animal>("Animal"),
Entity<Dog>("Dog"),
Entity<Dog>("Dog", indexes: [[\Dog.$nickname, \Dog.$age]]),
Entity<Person>("Person")
],
versionLock: [

View File

@@ -585,7 +585,7 @@ public final class CoreStoreSchema: DynamicSchema {
entityDescription.indexes = entity.indexes.map { (compoundIndexes) in
return NSFetchIndexDescription.init(
name: "_CoreStoreSchema_indexes_\(entityDescription.name!)_\(compoundIndexes.joined(separator: "-"))",
name: "_CoreStoreSchema_indexes_\(entityDescription.name!)_\(compoundIndexes.joined(separator: "_"))",
elements: compoundIndexes.map { (keyPath) in
return NSFetchIndexElementDescription(