patch-testrun.sql 958 B

12345678910111213141516171819202122232425262728293031
  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. -- Note: "if exists" will not work on older versions of Postgres
  10. DROP TABLE IF EXISTS testitem;
  11. DROP TABLE IF EXISTS testrun;
  12. DROP SEQUENCE IF EXISTS testrun_id_seq;
  13. CREATE SEQUENCE testrun_id_seq;
  14. CREATE TABLE testrun (
  15. tr_id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('testrun_id_seq'),
  16. tr_date TIMESTAMPTZ,
  17. tr_mw_version TEXT,
  18. tr_php_version TEXT,
  19. tr_db_version TEXT,
  20. tr_uname TEXT
  21. );
  22. CREATE TABLE testitem (
  23. ti_run INTEGER NOT NULL REFERENCES testrun(tr_id) ON DELETE CASCADE,
  24. ti_name TEXT NOT NULL,
  25. ti_success SMALLINT NOT NULL
  26. );
  27. CREATE UNIQUE INDEX testitem_uniq ON testitem(ti_run, ti_name);