summaryrefslogtreecommitdiff
path: root/maintenance/oracle
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /maintenance/oracle
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'maintenance/oracle')
-rw-r--r--maintenance/oracle/alterSharedConstraints.php23
-rw-r--r--maintenance/oracle/archives/patch-archive-ar_content_format.sql3
-rw-r--r--maintenance/oracle/archives/patch-archive-ar_content_model.sql3
-rw-r--r--maintenance/oracle/archives/patch-cat_hidden.sql4
-rw-r--r--maintenance/oracle/archives/patch-fa_sha1.sql5
-rw-r--r--maintenance/oracle/archives/patch-job_attempts.sql4
-rw-r--r--maintenance/oracle/archives/patch-job_token.sql12
-rw-r--r--maintenance/oracle/archives/patch-page-page_content_model.sql3
-rw-r--r--maintenance/oracle/archives/patch-rc_moved.sql4
-rw-r--r--maintenance/oracle/archives/patch-revision-rev_content_format.sql3
-rw-r--r--maintenance/oracle/archives/patch-revision-rev_content_model.sql3
-rw-r--r--maintenance/oracle/archives/patch-sites.sql34
-rw-r--r--maintenance/oracle/archives/patch-ss_admins.sql4
-rw-r--r--maintenance/oracle/archives/patch-testrun.sql2
-rw-r--r--maintenance/oracle/archives/patch-ufg_group-length-increase-255.sql (renamed from maintenance/oracle/archives/patch-ufg_group-length-increase.sql)2
-rw-r--r--maintenance/oracle/archives/patch-ug_group-length-increase-255.sql (renamed from maintenance/oracle/archives/patch-ug_group-length-increase.sql)2
-rw-r--r--maintenance/oracle/archives/patch-uploadstash-us_props.sql4
-rw-r--r--maintenance/oracle/archives/patch-user_former_groups.sql2
-rw-r--r--maintenance/oracle/tables.sql71
19 files changed, 161 insertions, 27 deletions
diff --git a/maintenance/oracle/alterSharedConstraints.php b/maintenance/oracle/alterSharedConstraints.php
index e222314d..a46c5e1f 100644
--- a/maintenance/oracle/alterSharedConstraints.php
+++ b/maintenance/oracle/alterSharedConstraints.php
@@ -15,13 +15,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
/**
* When using shared tables that are referenced by foreign keys on local
* tables you have to change the constraints on local tables.
- *
+ *
* The shared tables have to have GRANT REFERENCE on shared tables to local schema
* i.e.: GRANT REFERENCES (user_id) ON mwuser TO hubclient;
*/
@@ -40,12 +41,12 @@ class AlterSharedConstraints extends Maintenance {
public function execute() {
global $wgSharedDB, $wgSharedTables, $wgSharedPrefix, $wgDBprefix;
-
+
if ( $wgSharedDB == null ) {
$this->output( "Database sharing is not enabled\n" );
return;
}
-
+
$dbw = wfGetDB( DB_MASTER );
foreach ( $wgSharedTables as $table ) {
$stable = $dbw->tableNameInternal($table);
@@ -54,7 +55,7 @@ class AlterSharedConstraints extends Maintenance {
} else {
$ltable = "{$wgDBprefix}{$stable}" ;
}
-
+
$result = $dbw->query( "SELECT uc.constraint_name, uc.table_name, ucc.column_name, uccpk.table_name pk_table_name, uccpk.column_name pk_column_name, uc.delete_rule, uc.deferrable, uc.deferred
FROM user_constraints uc, user_cons_columns ucc, user_cons_columns uccpk
WHERE uc.constraint_type = 'R'
@@ -62,9 +63,9 @@ class AlterSharedConstraints extends Maintenance {
AND uccpk.constraint_name = uc.r_constraint_name
AND uccpk.table_name = '$ltable'" );
while (($row = $result->fetchRow()) !== false) {
-
+
$this->output( "Altering {$row['constraint_name']} ...");
-
+
try {
$dbw->query( "ALTER TABLE {$row['table_name']} DROP CONSTRAINT {$wgDBprefix}{$row['constraint_name']}" );
} catch (DBQueryError $exdb) {
@@ -72,13 +73,13 @@ class AlterSharedConstraints extends Maintenance {
throw $exdb;
}
}
-
+
$deleteRule = $row['delete_rule'] == 'NO ACTION' ? '' : "ON DELETE {$row['delete_rule']}";
- $dbw->query( "ALTER TABLE {$row['table_name']} ADD CONSTRAINT {$wgDBprefix}{$row['constraint_name']}
- FOREIGN KEY ({$row['column_name']})
- REFERENCES {$wgSharedDB}.$stable({$row['pk_column_name']})
+ $dbw->query( "ALTER TABLE {$row['table_name']} ADD CONSTRAINT {$wgDBprefix}{$row['constraint_name']}
+ FOREIGN KEY ({$row['column_name']})
+ REFERENCES {$wgSharedDB}.$stable({$row['pk_column_name']})
{$deleteRule} {$row['deferrable']} INITIALLY {$row['deferred']}" );
-
+
$this->output( "DONE\n" );
}
}
diff --git a/maintenance/oracle/archives/patch-archive-ar_content_format.sql b/maintenance/oracle/archives/patch-archive-ar_content_format.sql
new file mode 100644
index 00000000..0c0c0d94
--- /dev/null
+++ b/maintenance/oracle/archives/patch-archive-ar_content_format.sql
@@ -0,0 +1,3 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.archive ADD ar_content_format VARCHAR2(64);
diff --git a/maintenance/oracle/archives/patch-archive-ar_content_model.sql b/maintenance/oracle/archives/patch-archive-ar_content_model.sql
new file mode 100644
index 00000000..d18fc9e4
--- /dev/null
+++ b/maintenance/oracle/archives/patch-archive-ar_content_model.sql
@@ -0,0 +1,3 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.archive ADD ar_content_model VARCHAR2(32);
diff --git a/maintenance/oracle/archives/patch-cat_hidden.sql b/maintenance/oracle/archives/patch-cat_hidden.sql
new file mode 100644
index 00000000..d1649c7c
--- /dev/null
+++ b/maintenance/oracle/archives/patch-cat_hidden.sql
@@ -0,0 +1,4 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.category DROP COLUMN cat_hidden;
+
diff --git a/maintenance/oracle/archives/patch-fa_sha1.sql b/maintenance/oracle/archives/patch-fa_sha1.sql
new file mode 100644
index 00000000..70c9e60c
--- /dev/null
+++ b/maintenance/oracle/archives/patch-fa_sha1.sql
@@ -0,0 +1,5 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.filearchive ADD fa_sha1 VARCHAR2(32);
+CREATE INDEX &mw_prefix.filearchive_i05 ON &mw_prefix.filearchive (fa_sha1);
+
diff --git a/maintenance/oracle/archives/patch-job_attempts.sql b/maintenance/oracle/archives/patch-job_attempts.sql
new file mode 100644
index 00000000..b05c8779
--- /dev/null
+++ b/maintenance/oracle/archives/patch-job_attempts.sql
@@ -0,0 +1,4 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.job ADD job_attempts NUMBER DEFAULT 0 NOT NULL;
+CREATE INDEX &mw_prefix.job_i05 ON &mw_prefix.job (job_attempts);
diff --git a/maintenance/oracle/archives/patch-job_token.sql b/maintenance/oracle/archives/patch-job_token.sql
new file mode 100644
index 00000000..1a730e95
--- /dev/null
+++ b/maintenance/oracle/archives/patch-job_token.sql
@@ -0,0 +1,12 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.job ADD (
+ job_random NUMBER DEFAULT 0 NOT NULL,
+ job_token VARCHAR2(32),
+ job_token_timestamp TIMESTAMP(6) WITH TIME ZONE,
+ job_sha1 VARCHAR2(32)
+);
+
+CREATE INDEX &mw_prefix.job_i03 ON &mw_prefix.job (job_sha1);
+CREATE INDEX &mw_prefix.job_i04 ON &mw_prefix.job (job_cmd,job_token,job_random);
+
diff --git a/maintenance/oracle/archives/patch-page-page_content_model.sql b/maintenance/oracle/archives/patch-page-page_content_model.sql
new file mode 100644
index 00000000..e5839d9a
--- /dev/null
+++ b/maintenance/oracle/archives/patch-page-page_content_model.sql
@@ -0,0 +1,3 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.page ADD page_content_model VARCHAR2(32);
diff --git a/maintenance/oracle/archives/patch-rc_moved.sql b/maintenance/oracle/archives/patch-rc_moved.sql
new file mode 100644
index 00000000..2a71315d
--- /dev/null
+++ b/maintenance/oracle/archives/patch-rc_moved.sql
@@ -0,0 +1,4 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.recentchanges DROP ( rc_moved_to_ns, rc_moved_to_title );
+
diff --git a/maintenance/oracle/archives/patch-revision-rev_content_format.sql b/maintenance/oracle/archives/patch-revision-rev_content_format.sql
new file mode 100644
index 00000000..ebde71c9
--- /dev/null
+++ b/maintenance/oracle/archives/patch-revision-rev_content_format.sql
@@ -0,0 +1,3 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.revision ADD rev_content_format VARCHAR2(64);
diff --git a/maintenance/oracle/archives/patch-revision-rev_content_model.sql b/maintenance/oracle/archives/patch-revision-rev_content_model.sql
new file mode 100644
index 00000000..dd226423
--- /dev/null
+++ b/maintenance/oracle/archives/patch-revision-rev_content_model.sql
@@ -0,0 +1,3 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.revision ADD rev_content_model VARCHAR2(32);
diff --git a/maintenance/oracle/archives/patch-sites.sql b/maintenance/oracle/archives/patch-sites.sql
new file mode 100644
index 00000000..868b210f
--- /dev/null
+++ b/maintenance/oracle/archives/patch-sites.sql
@@ -0,0 +1,34 @@
+define mw_prefix='{$wgDBprefix}';
+
+CREATE SEQUENCE sites_site_id_seq MINVALUE 0 START WITH 0;
+CREATE TABLE &mw_prefix.sites (
+ site_id NUMBER NOT NULL,
+ site_global_key VARCHAR2(32) NOT NULL,
+ site_type VARCHAR2(32) NOT NULL,
+ site_group VARCHAR2(32) NOT NULL,
+ site_source VARCHAR2(32) NOT NULL,
+ site_language VARCHAR2(32) NOT NULL,
+ site_protocol VARCHAR2(32) NOT NULL,
+ site_domain VARCHAR2(255) NOT NULL,
+ site_data BLOB NOT NULL,
+ site_forward NUMBER(1) NOT NULL,
+ site_config BLOB NOT NULL
+);
+ALTER TABLE &mw_prefix.sites ADD CONSTRAINT &mw_prefix.sites_pk PRIMARY KEY (site_id);
+CREATE UNIQUE INDEX &mw_prefix.sites_u01 ON &mw_prefix.sites (site_global_key);
+CREATE INDEX &mw_prefix.sites_i01 ON &mw_prefix.sites (site_type);
+CREATE INDEX &mw_prefix.sites_i02 ON &mw_prefix.sites (site_group);
+CREATE INDEX &mw_prefix.sites_i03 ON &mw_prefix.sites (site_source);
+CREATE INDEX &mw_prefix.sites_i04 ON &mw_prefix.sites (site_language);
+CREATE INDEX &mw_prefix.sites_i05 ON &mw_prefix.sites (site_protocol);
+CREATE INDEX &mw_prefix.sites_i06 ON &mw_prefix.sites (site_domain);
+CREATE INDEX &mw_prefix.sites_i07 ON &mw_prefix.sites (site_forward);
+
+CREATE TABLE &mw_prefix.site_identifiers (
+ si_site NUMBER NOT NULL,
+ si_type VARCHAR2(32) NOT NULL,
+ si_key VARCHAR2(32) NOT NULL
+);
+CREATE UNIQUE INDEX &mw_prefix.site_identifiers_u01 ON &mw_prefix.site_identifiers (si_type, si_key);
+CREATE INDEX &mw_prefix.site_identifiers_i01 ON &mw_prefix.site_identifiers (si_site);
+CREATE INDEX &mw_prefix.site_identifiers_i02 ON &mw_prefix.site_identifiers (si_key);
diff --git a/maintenance/oracle/archives/patch-ss_admins.sql b/maintenance/oracle/archives/patch-ss_admins.sql
new file mode 100644
index 00000000..c2e9242e
--- /dev/null
+++ b/maintenance/oracle/archives/patch-ss_admins.sql
@@ -0,0 +1,4 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.site_stats DROP COLUMN ss_admins;
+
diff --git a/maintenance/oracle/archives/patch-testrun.sql b/maintenance/oracle/archives/patch-testrun.sql
index 6e3e1b7c..84facabc 100644
--- a/maintenance/oracle/archives/patch-testrun.sql
+++ b/maintenance/oracle/archives/patch-testrun.sql
@@ -25,7 +25,7 @@ BEFORE UPDATE FOR EACH ROW
ON &mw_prefix.testrun
BEGIN
SELECT testrun_tr_id_seq.NEXTVAL into :NEW.tr_id FROM dual;
-END;
+END;
CREATE TABLE /*$wgDBprefix*/testitem (
ti_run NUMBER NOT NULL REFERENCES &mw_prefix.testrun (tr_id) ON DELETE CASCADE,
diff --git a/maintenance/oracle/archives/patch-ufg_group-length-increase.sql b/maintenance/oracle/archives/patch-ufg_group-length-increase-255.sql
index a48b8bff..6a4a7517 100644
--- a/maintenance/oracle/archives/patch-ufg_group-length-increase.sql
+++ b/maintenance/oracle/archives/patch-ufg_group-length-increase-255.sql
@@ -2,7 +2,7 @@ define mw_prefix='{$wgDBprefix}';
/*$mw$*/
BEGIN
- EXECUTE IMMEDIATE 'ALTER TABLE &mw_prefix.user_former_groups MODIFY ufg_group VARCHAR2(32) NOT NULL';
+ EXECUTE IMMEDIATE 'ALTER TABLE &mw_prefix.user_former_groups MODIFY ufg_group VARCHAR2(255) NOT NULL';
EXCEPTION WHEN OTHERS THEN
IF (SQLCODE = -01442) THEN NULL; ELSE RAISE; END IF;
END;
diff --git a/maintenance/oracle/archives/patch-ug_group-length-increase.sql b/maintenance/oracle/archives/patch-ug_group-length-increase-255.sql
index 89e55329..00a5e7b2 100644
--- a/maintenance/oracle/archives/patch-ug_group-length-increase.sql
+++ b/maintenance/oracle/archives/patch-ug_group-length-increase-255.sql
@@ -2,7 +2,7 @@ define mw_prefix='{$wgDBprefix}';
/*$mw$*/
BEGIN
- EXECUTE IMMEDIATE 'ALTER TABLE &mw_prefix.user_groups MODIFY ug_group VARCHAR2(32) NOT NULL';
+ EXECUTE IMMEDIATE 'ALTER TABLE &mw_prefix.user_groups MODIFY ug_group VARCHAR2(255) NOT NULL';
EXCEPTION WHEN OTHERS THEN
IF (SQLCODE = -01442) THEN NULL; ELSE RAISE; END IF;
END;
diff --git a/maintenance/oracle/archives/patch-uploadstash-us_props.sql b/maintenance/oracle/archives/patch-uploadstash-us_props.sql
new file mode 100644
index 00000000..8962dc7c
--- /dev/null
+++ b/maintenance/oracle/archives/patch-uploadstash-us_props.sql
@@ -0,0 +1,4 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.uploadstash ADD us_props BLOB;
+
diff --git a/maintenance/oracle/archives/patch-user_former_groups.sql b/maintenance/oracle/archives/patch-user_former_groups.sql
index 59147eb2..c14824eb 100644
--- a/maintenance/oracle/archives/patch-user_former_groups.sql
+++ b/maintenance/oracle/archives/patch-user_former_groups.sql
@@ -2,7 +2,7 @@ define mw_prefix='{$wgDBprefix}';
CREATE TABLE &mw_prefix.user_former_groups (
ufg_user NUMBER DEFAULT 0 NOT NULL,
- ufg_group VARCHAR2(16) NOT NULL
+ ufg_group VARCHAR2(255) NOT NULL
);
ALTER TABLE &mw_prefix.user_former_groups ADD CONSTRAINT &mw_prefix.user_former_groups_fk1 FOREIGN KEY (ufg_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
CREATE UNIQUE INDEX &mw_prefix.user_former_groups_u01 ON &mw_prefix.user_former_groups (ufg_user,ufg_group);
diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql
index 26600eba..ba69da1b 100644
--- a/maintenance/oracle/tables.sql
+++ b/maintenance/oracle/tables.sql
@@ -31,7 +31,7 @@ INSERT INTO &mw_prefix.mwuser
CREATE TABLE &mw_prefix.user_groups (
ug_user NUMBER DEFAULT 0 NOT NULL,
- ug_group VARCHAR2(32) NOT NULL
+ ug_group VARCHAR2(255) NOT NULL
);
ALTER TABLE &mw_prefix.user_groups ADD CONSTRAINT &mw_prefix.user_groups_fk1 FOREIGN KEY (ug_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
CREATE UNIQUE INDEX &mw_prefix.user_groups_u01 ON &mw_prefix.user_groups (ug_user,ug_group);
@@ -39,7 +39,7 @@ CREATE INDEX &mw_prefix.user_groups_i01 ON &mw_prefix.user_groups (ug_group);
CREATE TABLE &mw_prefix.user_former_groups (
ufg_user NUMBER DEFAULT 0 NOT NULL,
- ufg_group VARCHAR2(16) NOT NULL
+ ufg_group VARCHAR2(255) NOT NULL
);
ALTER TABLE &mw_prefix.user_former_groups ADD CONSTRAINT &mw_prefix.user_former_groups_fk1 FOREIGN KEY (ufg_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
CREATE UNIQUE INDEX &mw_prefix.user_former_groups_u01 ON &mw_prefix.user_former_groups (ufg_user,ufg_group);
@@ -73,7 +73,8 @@ CREATE TABLE &mw_prefix.page (
page_random NUMBER(15,14) NOT NULL,
page_touched TIMESTAMP(6) WITH TIME ZONE,
page_latest NUMBER DEFAULT 0 NOT NULL, -- FK?
- page_len NUMBER DEFAULT 0 NOT NULL
+ page_len NUMBER DEFAULT 0 NOT NULL,
+ page_content_model VARCHAR2(32)
);
ALTER TABLE &mw_prefix.page ADD CONSTRAINT &mw_prefix.page_pk PRIMARY KEY (page_id);
CREATE UNIQUE INDEX &mw_prefix.page_u01 ON &mw_prefix.page (page_namespace,page_title);
@@ -83,7 +84,7 @@ CREATE INDEX &mw_prefix.page_i03 ON &mw_prefix.page (page_is_redirect, page_name
-- Create a dummy page to satisfy fk contraints especially with revisions
INSERT INTO &mw_prefix.page
- VALUES (0, 0, ' ', NULL, 0, 0, 0, 0, current_timestamp, 0, 0);
+ VALUES (0, 0, ' ', NULL, 0, 0, 0, 0, current_timestamp, 0, 0, NULL);
/*$mw$*/
CREATE TRIGGER &mw_prefix.page_set_random BEFORE INSERT ON &mw_prefix.page
@@ -106,7 +107,9 @@ CREATE TABLE &mw_prefix.revision (
rev_deleted CHAR(1) DEFAULT '0' NOT NULL,
rev_len NUMBER NULL,
rev_parent_id NUMBER DEFAULT NULL,
- rev_sha1 VARCHAR2(32) NULL
+ rev_sha1 VARCHAR2(32) NULL,
+ rev_content_model VARCHAR2(32),
+ rev_content_format VARCHAR2(64)
);
ALTER TABLE &mw_prefix.revision ADD CONSTRAINT &mw_prefix.revision_pk PRIMARY KEY (rev_id);
ALTER TABLE &mw_prefix.revision ADD CONSTRAINT &mw_prefix.revision_fk1 FOREIGN KEY (rev_page) REFERENCES &mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
@@ -142,7 +145,9 @@ CREATE TABLE &mw_prefix.archive (
ar_len NUMBER,
ar_page_id NUMBER,
ar_parent_id NUMBER,
- ar_sha1 VARCHAR2(32) NULL
+ ar_sha1 VARCHAR2(32),
+ ar_content_model VARCHAR2(32),
+ ar_content_format VARCHAR2(64)
);
ALTER TABLE &mw_prefix.archive ADD CONSTRAINT &mw_prefix.archive_fk1 FOREIGN KEY (ar_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
CREATE INDEX &mw_prefix.archive_i01 ON &mw_prefix.archive (ar_namespace,ar_title,ar_timestamp);
@@ -197,8 +202,7 @@ CREATE TABLE &mw_prefix.category (
cat_title VARCHAR2(255) NOT NULL,
cat_pages NUMBER DEFAULT 0 NOT NULL,
cat_subcats NUMBER DEFAULT 0 NOT NULL,
- cat_files NUMBER DEFAULT 0 NOT NULL,
- cat_hidden NUMBER DEFAULT 0 NOT NULL
+ cat_files NUMBER DEFAULT 0 NOT NULL
);
ALTER TABLE &mw_prefix.category ADD CONSTRAINT &mw_prefix.category_pk PRIMARY KEY (cat_id);
CREATE UNIQUE INDEX &mw_prefix.category_u01 ON &mw_prefix.category (cat_title);
@@ -246,7 +250,6 @@ CREATE TABLE &mw_prefix.site_stats (
ss_total_pages NUMBER DEFAULT -1,
ss_users NUMBER DEFAULT -1,
ss_active_users NUMBER DEFAULT -1,
- ss_admins NUMBER DEFAULT -1,
ss_images NUMBER DEFAULT 0
);
CREATE UNIQUE INDEX &mw_prefix.site_stats_u01 ON &mw_prefix.site_stats (ss_row_id);
@@ -358,7 +361,8 @@ CREATE TABLE &mw_prefix.filearchive (
fa_user NUMBER DEFAULT 0 NOT NULL,
fa_user_text VARCHAR2(255) NOT NULL,
fa_timestamp TIMESTAMP(6) WITH TIME ZONE,
- fa_deleted NUMBER DEFAULT 0 NOT NULL
+ fa_deleted NUMBER DEFAULT 0 NOT NULL,
+ fa_sha1 VARCHAR2(32)
);
ALTER TABLE &mw_prefix.filearchive ADD CONSTRAINT &mw_prefix.filearchive_pk PRIMARY KEY (fa_id);
ALTER TABLE &mw_prefix.filearchive ADD CONSTRAINT &mw_prefix.filearchive_fk1 FOREIGN KEY (fa_deleted_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
@@ -367,6 +371,7 @@ CREATE INDEX &mw_prefix.filearchive_i01 ON &mw_prefix.filearchive (fa_name, fa_t
CREATE INDEX &mw_prefix.filearchive_i02 ON &mw_prefix.filearchive (fa_storage_group, fa_storage_key);
CREATE INDEX &mw_prefix.filearchive_i03 ON &mw_prefix.filearchive (fa_deleted_timestamp);
CREATE INDEX &mw_prefix.filearchive_i04 ON &mw_prefix.filearchive (fa_user_text,fa_timestamp);
+CREATE INDEX &mw_prefix.filearchive_i05 ON &mw_prefix.filearchive (fa_sha1);
CREATE SEQUENCE uploadstash_us_id_seq;
CREATE TABLE &mw_prefix.uploadstash (
@@ -385,7 +390,8 @@ CREATE TABLE &mw_prefix.uploadstash (
us_media_type VARCHAR2(32) DEFAULT NULL,
us_image_width NUMBER,
us_image_height NUMBER,
- us_image_bits NUMBER
+ us_image_bits NUMBER,
+ us_props BLOB
);
ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_pk PRIMARY KEY (us_id);
ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_fk1 FOREIGN KEY (us_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
@@ -523,11 +529,19 @@ CREATE TABLE &mw_prefix.job (
job_namespace NUMBER DEFAULT 0 NOT NULL,
job_title VARCHAR2(255) NOT NULL,
job_timestamp TIMESTAMP(6) WITH TIME ZONE NULL,
- job_params CLOB NOT NULL
+ job_params CLOB NOT NULL,
+ job_random NUMBER DEFAULT 0 NOT NULL,
+ job_token VARCHAR2(32),
+ job_token_timestamp TIMESTAMP(6) WITH TIME ZONE,
+ job_sha1 VARCHAR2(32),
+ job_attempts NUMBER DEFAULT 0 NOT NULL
);
ALTER TABLE &mw_prefix.job ADD CONSTRAINT &mw_prefix.job_pk PRIMARY KEY (job_id);
CREATE INDEX &mw_prefix.job_i01 ON &mw_prefix.job (job_cmd, job_namespace, job_title);
CREATE INDEX &mw_prefix.job_i02 ON &mw_prefix.job (job_timestamp);
+CREATE INDEX &mw_prefix.job_i03 ON &mw_prefix.job (job_sha1);
+CREATE INDEX &mw_prefix.job_i04 ON &mw_prefix.job (job_cmd,job_token,job_random);
+CREATE INDEX &mw_prefix.job_i05 ON &mw_prefix.job (job_attempts);
CREATE TABLE &mw_prefix.querycache_info (
qci_type VARCHAR2(32) NOT NULL,
@@ -667,6 +681,39 @@ CREATE TABLE &mw_prefix.module_deps (
);
CREATE UNIQUE INDEX &mw_prefix.module_deps_u01 ON &mw_prefix.module_deps (md_module, md_skin);
+CREATE SEQUENCE sites_site_id_seq MINVALUE 0 START WITH 0;
+CREATE TABLE &mw_prefix.sites (
+ site_id NUMBER NOT NULL,
+ site_global_key VARCHAR2(32) NOT NULL,
+ site_type VARCHAR2(32) NOT NULL,
+ site_group VARCHAR2(32) NOT NULL,
+ site_source VARCHAR2(32) NOT NULL,
+ site_language VARCHAR2(32) NOT NULL,
+ site_protocol VARCHAR2(32) NOT NULL,
+ site_domain VARCHAR2(255) NOT NULL,
+ site_data BLOB NOT NULL,
+ site_forward NUMBER(1) NOT NULL,
+ site_config BLOB NOT NULL
+);
+ALTER TABLE &mw_prefix.sites ADD CONSTRAINT &mw_prefix.sites_pk PRIMARY KEY (site_id);
+CREATE UNIQUE INDEX &mw_prefix.sites_u01 ON &mw_prefix.sites (site_global_key);
+CREATE INDEX &mw_prefix.sites_i01 ON &mw_prefix.sites (site_type);
+CREATE INDEX &mw_prefix.sites_i02 ON &mw_prefix.sites (site_group);
+CREATE INDEX &mw_prefix.sites_i03 ON &mw_prefix.sites (site_source);
+CREATE INDEX &mw_prefix.sites_i04 ON &mw_prefix.sites (site_language);
+CREATE INDEX &mw_prefix.sites_i05 ON &mw_prefix.sites (site_protocol);
+CREATE INDEX &mw_prefix.sites_i06 ON &mw_prefix.sites (site_domain);
+CREATE INDEX &mw_prefix.sites_i07 ON &mw_prefix.sites (site_forward);
+
+CREATE TABLE &mw_prefix.site_identifiers (
+ si_site NUMBER NOT NULL,
+ si_type VARCHAR2(32) NOT NULL,
+ si_key VARCHAR2(32) NOT NULL
+);
+CREATE UNIQUE INDEX &mw_prefix.site_identifiers_u01 ON &mw_prefix.site_identifiers (si_type, si_key);
+CREATE INDEX &mw_prefix.site_identifiers_i01 ON &mw_prefix.site_identifiers (si_site);
+CREATE INDEX &mw_prefix.site_identifiers_i02 ON &mw_prefix.site_identifiers (si_key);
+
-- do not prefix this table as it breaks parserTests
CREATE TABLE wiki_field_info_full (
table_name VARCHAR2(35) NOT NULL,