You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// one/many-to-many: nullify the foreign key on the destination table
252
252
letsql="UPDATE \(relationship.destinationEntity.rawValue.quotedIdentifier) SET \(relationship.inverseRelationship.rawValue.quotedIdentifier) = NULL WHERE \(relationship.inverseRelationship.rawValue.quotedIdentifier) = ?"
253
-
tryrun(sql,[id.rawValue])
253
+
tryrun(sql,[id.rawValue.binding])
254
254
case.toMany:
255
255
// many-to-many: drop this row's links from the join table
letsql="UPDATE \(relationship.destinationEntity.rawValue.quotedIdentifier) SET \(relationship.inverseRelationship.rawValue.quotedIdentifier) = NULL WHERE \(relationship.inverseRelationship.rawValue.quotedIdentifier) = ?"
263
-
tryrun(sql,[id.rawValue])
263
+
tryrun(sql,[id.rawValue.binding])
264
264
}
265
265
}
266
266
}
267
267
letsql="DELETE FROM \(entity.rawValue.quotedIdentifier) WHERE \(SQLiteDatabase.primaryKeyColumn.quotedIdentifier) = ?"
letsql="SELECT \(SQLiteDatabase.primaryKeyColumn.quotedIdentifier) FROM \(relationship.destinationEntity.rawValue.quotedIdentifier) WHERE \(relationship.inverseRelationship.rawValue.quotedIdentifier) = ?"
0 commit comments