Since we're making other changes, let's bring in that rev_parent_id field from branch...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Mar 2007 20:50:11 +0000 (20:50 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Mar 2007 20:50:11 +0000 (20:50 +0000)
maintenance/archives/patch-rev_parent_id.sql [new file with mode: 0644]
maintenance/mysql5/tables-binary.sql
maintenance/mysql5/tables.sql
maintenance/postgres/tables.sql
maintenance/tables.sql
maintenance/updaters.inc

diff --git a/maintenance/archives/patch-rev_parent_id.sql b/maintenance/archives/patch-rev_parent_id.sql
new file mode 100644 (file)
index 0000000..971122b
--- /dev/null
@@ -0,0 +1,9 @@
+--
+-- Key to revision.rev_id
+-- This field is used to add support for a tree structure (The Adjacency List Model)
+--
+-- 2007-03-04
+--
+
+ALTER TABLE /*$wgDBprefix*/revision
+  ADD rev_parent_id int(8) unsigned default NULL;
index d7d3b2c..e75e903 100644 (file)
@@ -291,7 +291,14 @@ CREATE TABLE /*$wgDBprefix*/revision (
   
   -- Not yet used; reserved for future changes to the deletion system.
   rev_deleted tinyint(1) unsigned NOT NULL default '0',
-  
+
+  -- Length of this revision in bytes
+  rev_len int(8) unsigned,
+
+  --Key to revision.rev_id
+  --This field is used to add support for a tree structure (The Adjacency List Model)
+  rev_parent_id int(8) unsigned default NULL,
+
   PRIMARY KEY rev_page_id (rev_page, rev_id),
   UNIQUE INDEX rev_id (rev_id),
   INDEX rev_timestamp (rev_timestamp),
index 6ea6243..8a8fed1 100644 (file)
@@ -282,7 +282,14 @@ CREATE TABLE /*$wgDBprefix*/revision (
   
   -- Not yet used; reserved for future changes to the deletion system.
   rev_deleted tinyint(1) unsigned NOT NULL default '0',
-  
+
+  -- Length of this revision in bytes
+  rev_len int(8) unsigned,
+
+  --Key to revision.rev_id
+  --This field is used to add support for a tree structure (The Adjacency List Model)
+  rev_parent_id int(8) unsigned default NULL,
+
   PRIMARY KEY rev_page_id (rev_page, rev_id),
   UNIQUE INDEX rev_id (rev_id),
   INDEX rev_timestamp (rev_timestamp),
index bdbf2e1..b8412ba 100644 (file)
@@ -93,7 +93,8 @@ CREATE TABLE revision (
   rev_timestamp   TIMESTAMPTZ  NOT NULL,
   rev_minor_edit  CHAR         NOT NULL  DEFAULT '0',
   rev_deleted     CHAR         NOT NULL  DEFAULT '0',
-  rev_len         INTEGER          NULL
+  rev_len         INTEGER          NULL,
+  rev_parent_id   INTEGER                 DEFAULT NULL
 );
 CREATE UNIQUE INDEX revision_unique ON revision (rev_page, rev_id);
 CREATE INDEX rev_text_id_idx        ON revision (rev_text_id);
index ba1a885..8a75ce7 100644 (file)
@@ -273,6 +273,10 @@ CREATE TABLE /*$wgDBprefix*/revision (
   -- Length of this revision in bytes
   rev_len int(8) unsigned,
 
+  --Key to revision.rev_id
+  --This field is used to add support for a tree structure (The Adjacency List Model)
+  rev_parent_id int(8) unsigned default NULL,
+
   PRIMARY KEY rev_page_id (rev_page, rev_id),
   UNIQUE INDEX rev_id (rev_id),
   INDEX rev_timestamp (rev_timestamp),
index 902a38c..ca2da34 100644 (file)
@@ -69,6 +69,7 @@ $wgNewFields = array(
        array( 'logging',       'log_id',               'patch-log_id.sql' ),
        array( 'page_restrictions', 'pr_id',            'patch-page_restrictions_sortkey.sql' ),
        array( 'revision',      'rev_len',              'patch-rev_len.sql' ),
+       array( 'revision',      'rev_parent_id',        'patch-rev_parent_id.sql' ),
 );
 
 function rename_table( $from, $to, $patch ) {
@@ -414,7 +415,7 @@ function do_schema_restructuring() {
                        rev_timestamp char(14) binary NOT NULL default '',
                        rev_minor_edit tinyint(1) unsigned NOT NULL default '0',
                        rev_deleted tinyint(1) unsigned NOT NULL default '0',
-
+                       rev_parent_id int(8) unsigned default NULL,
                        PRIMARY KEY rev_page_id (rev_page, rev_id),
                        UNIQUE INDEX rev_id (rev_id),
                        INDEX rev_timestamp (rev_timestamp),