Failing test for multiple foreign keys on a column

This commit is contained in:
Gwendal Roué committed 2016-08-10 13:23:19 +02:00
1 parent 936d2e56ea
commit 4d9c7d0dcb
1 file changed
+3 -1
@@ -213,11 +213,13 @@ class SQLTableBuilderTests: GRDBTestCase {
try db.create(table: "child") { t in
t.column("parentName", .Text).references("parent", onDelete: .Cascade, onUpdate: .Cascade)
t.column("parentEmail", .Text).references("parent", column: "email", onDelete: .Restrict, deferred: true)
t.column("weird", .Text).references("parent", column: "name").references("parent", column: "email")
}
XCTAssertEqual(self.lastSQLQuery,
"CREATE TABLE \"child\" (" +
"\"parentName\" TEXT REFERENCES \"parent\"(\"name\") ON DELETE CASCADE ON UPDATE CASCADE, " +
"\"parentEmail\" TEXT REFERENCES \"parent\"(\"email\") ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED" +
"\"parentEmail\" TEXT REFERENCES \"parent\"(\"email\") ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED, " +
"\"weird\" TEXT REFERENCES \"parent\"(\"name\") REFERENCES \"parent\"(\"email\")" +
")")
}
}