]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - maintenance/oracle/archives/patch-testrun.sql
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / maintenance / oracle / archives / patch-testrun.sql
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 -- defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}';
8 define mw_prefix='{$wgDBprefix}';
9
10 DROP TABLE &mw_prefix.testitem CASCADE CONSTRAINTS;
11 DROP TABLE &mw_prefix.testrun CASCADE CONSTRAINTS;
12
13 CREATE SEQUENCE testrun_tr_id_seq;
14 CREATE TABLE &mw_prefix.testrun (
15   tr_id NUMBER NOT NULL,
16   tr_date DATE,
17   tr_mw_version BLOB,
18   tr_php_version BLOB,
19   tr_db_version BLOB,
20   tr_uname BLOB,
21 );
22 ALTER TABLE &mw_prefix.testrun ADD CONSTRAINT &mw_prefix.testrun_pk PRIMARY KEY (tr_id);
23 CREATE OR REPLACE TRIGGER &mw_prefix.testrun_bir
24 BEFORE UPDATE FOR EACH ROW
25 ON &mw_prefix.testrun
26 BEGIN
27   SELECT testrun_tr_id_seq.NEXTVAL into :NEW.tr_id FROM dual;
28 END;
29
30 CREATE TABLE /*$wgDBprefix*/testitem (
31   ti_run NUMBER NOT NULL REFERENCES &mw_prefix.testrun (tr_id) ON DELETE CASCADE,
32   ti_name VARCHAR22(255),
33   ti_success NUMBER(1)
34 );
35 CREATE UNIQUE INDEX &mw_prefix.testitem_u01 ON &mw_prefix.testitem (ti_run, ti_name);
36 CREATE UNIQUE INDEX &mw_prefix.testitem_u01 ON &mw_prefix.testitem (ti_run, ti_success);
37