mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-11 21:11:58 +01:00
Merge pull request #421 from xquezme/develop
Fix compound indexes for dynamic models
This commit is contained in:
@@ -197,7 +197,7 @@ class DynamicModelTests: BaseTestDataTestCase {
|
|||||||
modelVersion: "V1",
|
modelVersion: "V1",
|
||||||
entities: [
|
entities: [
|
||||||
Entity<Animal>("Animal"),
|
Entity<Animal>("Animal"),
|
||||||
Entity<Dog>("Dog"),
|
Entity<Dog>("Dog", indexes: [[\Dog.$nickname, \Dog.$age]]),
|
||||||
Entity<Person>("Person")
|
Entity<Person>("Person")
|
||||||
],
|
],
|
||||||
versionLock: [
|
versionLock: [
|
||||||
|
|||||||
@@ -585,7 +585,7 @@ public final class CoreStoreSchema: DynamicSchema {
|
|||||||
entityDescription.indexes = entity.indexes.map { (compoundIndexes) in
|
entityDescription.indexes = entity.indexes.map { (compoundIndexes) in
|
||||||
|
|
||||||
return NSFetchIndexDescription.init(
|
return NSFetchIndexDescription.init(
|
||||||
name: "_CoreStoreSchema_indexes_\(entityDescription.name!)_\(compoundIndexes.joined(separator: "-"))",
|
name: "_CoreStoreSchema_indexes_\(entityDescription.name!)_\(compoundIndexes.joined(separator: "_"))",
|
||||||
elements: compoundIndexes.map { (keyPath) in
|
elements: compoundIndexes.map { (keyPath) in
|
||||||
|
|
||||||
return NSFetchIndexElementDescription(
|
return NSFetchIndexElementDescription(
|
||||||
|
|||||||
Reference in New Issue
Block a user