-SQL
- , PQ_TEST_TABLE_NAME));
-define("PQ_TEST_DROP_TABLE", sprintf("drop table if exists %s", PQ_TEST_TABLE_NAME));
-define("PQ_TEST_CREATE_DATA", sprintf(
-<<<SQL
- insert into %1\$s values (default, 'yesterday', -1, -1.1, 'yesterday');
- insert into %1\$s values (default, 'today', 0, 0, 'today');
- insert into %1\$s values (default, 'tomorrow', 1, 1.1, 'tomorrow');
-SQL
- , PQ_TEST_TABLE_NAME
-));
+SQL;
+
+const PQ_TEST_TABLE_DROP = <<<SQL
+ drop table if exists test cascade;
+SQL;
+
+const PQ_TEST_REFTABLE_CREATE = <<<SQL
+ drop table if exists reftest cascade;
+ create table reftest (
+ test_id integer not null references test on delete cascade,
+ another_test_id integer not null references test on delete cascade
+ );
+SQL;
+
+const PQ_TEST_REFTABLE_DROP = <<<SQL
+ drop table if exists reftest cascade;
+SQL;
+
+const PQ_TEST_DATA = <<<SQL
+ insert into test values (default, 'yesterday', -1, -1.1, 'yesterday');
+ insert into test values (default, 'today', 0, 0, 'today');
+ insert into test values (default, 'tomorrow', 1, 1.1, 'tomorrow');
+
+ insert into reftest values (1,3);
+ insert into reftest values (2,2);
+ insert into reftest values (3,1);
+SQL;