fixed migrationchain validation

This commit is contained in:
John Estropia
2015-07-13 16:16:19 +09:00
parent f99349f99d
commit e7bcb501fd
2 changed files with 43 additions and 1 deletions

View File

@@ -115,6 +115,8 @@ public struct MigrationChain: NilLiteralConvertible, StringLiteralConvertible, D
if let _ = versionTree.updateValue(tuple.1, forKey: tuple.0) {
CoreStore.assert(false, "\(typeName(MigrationChain))'s migration chain could not be created due to ambiguous version paths.")
valid = false
}
return versionTree
@@ -133,7 +135,9 @@ public struct MigrationChain: NilLiteralConvertible, StringLiteralConvertible, D
var version = start
while let nextVersion = versionTree[version] where nextVersion != version {
if checklist.contains(version) {
if checklist.contains(nextVersion) {
CoreStore.assert(false, "\(typeName(MigrationChain))'s migration chain could not be created due to looping version paths.")
return true
}