mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Failing test for multiple foreign keys on a column
This commit is contained in:
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\")" +
|
||||
")")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user