| 1 |
-- |
| 2 |
-- Optional tables for parserTests recording mode |
| 3 |
-- With --record option, success data will be saved to these tables, |
| 4 |
-- and comparisons of what's changed from the previous run will be |
| 5 |
-- displayed at the end of each run. |
| 6 |
-- |
| 7 |
-- This file is for the Postgres version of the tables |
| 8 |
-- |
| 9 |
|
| 10 |
-- Note: "if exists" will not work on older versions of Postgres |
| 11 |
DROP TABLE IF EXISTS testitem; |
| 12 |
DROP TABLE IF EXISTS testrun; |
| 13 |
DROP SEQUENCE IF EXISTS testrun_id_seq; |
| 14 |
|
| 15 |
CREATE SEQUENCE testrun_id_seq; |
| 16 |
CREATE TABLE testrun ( |
| 17 |
tr_id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('testrun_id_seq'), |
| 18 |
tr_date TIMESTAMPTZ, |
| 19 |
tr_mw_version TEXT, |
| 20 |
tr_php_version TEXT, |
| 21 |
tr_db_version TEXT, |
| 22 |
tr_uname TEXT |
| 23 |
); |
| 24 |
|
| 25 |
CREATE TABLE testitem ( |
| 26 |
ti_run INTEGER NOT NULL REFERENCES testrun(tr_id) ON DELETE CASCADE, |
| 27 |
ti_name TEXT NOT NULL, |
| 28 |
ti_success SMALLINT NOT NULL |
| 29 |
); |
| 30 |
CREATE UNIQUE INDEX testitem_uniq ON testitem(ti_run, ti_name); |