File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ private slots:
1515 void parseSQL ();
1616 void parseSQLdefaultexpr ();
1717 void parseSQLMultiPk ();
18+ void parseSQLForeignKey ();
1819};
1920
2021void TestTable::sqlOutput ()
@@ -148,5 +149,17 @@ void TestTable::parseSQLMultiPk()
148149 QVERIFY (tab.primarykey ().contains (tab.fields ().at (1 )));
149150}
150151
152+ void TestTable::parseSQLForeignKey ()
153+ {
154+ QString sSQL = " CREATE TABLE grammar_test(id, test, FOREIGN KEY(test) REFERENCES other_table);" ;
155+
156+ Table tab = Table::parseSQL (sSQL );
157+
158+ QVERIFY (tab.name () == " grammar_test" );
159+ QVERIFY (tab.fields ().at (0 )->name () == " id" );
160+ QVERIFY (tab.fields ().at (1 )->name () == " test" );
161+
162+ }
163+
151164QTEST_MAIN (TestTable)
152165#include " testsqlobjects.moc"
You can’t perform that action at this time.
0 commit comments