Revision table tree patch (No objections have been raised so i'm committing it to...
authorRoman Nosov <roman@users.mediawiki.org>
Fri, 9 Feb 2007 11:22:13 +0000 (11:22 +0000)
committerRoman Nosov <roman@users.mediawiki.org>
Fri, 9 Feb 2007 11:22:13 +0000 (11:22 +0000)
RELEASE-NOTES
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

index e6c1468..2a89925 100644 (file)
@@ -184,6 +184,7 @@ lighter making things easier to read.
   of other tables while they work.
 * Message names changed for AlphabeticPager introduced with r19758
   for better localisations.
+* Tree structure has been added to revision table
 
 == Languages updated ==
 
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 7f970f9..0d98f5f 100644 (file)
@@ -292,6 +292,10 @@ CREATE TABLE /*$wgDBprefix*/revision (
   -- Not yet used; reserved for future changes to the deletion system.
   rev_deleted tinyint(1) unsigned NOT NULL default '0',
   
+  --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 11c9b16..9afbd7d 100644 (file)
@@ -283,6 +283,10 @@ CREATE TABLE /*$wgDBprefix*/revision (
   -- Not yet used; reserved for future changes to the deletion system.
   rev_deleted tinyint(1) unsigned NOT NULL default '0',
   
+  --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 62e021e..1f7162b 100644 (file)
@@ -92,7 +92,9 @@ CREATE TABLE revision (
   rev_user_text   TEXT         NOT NULL,
   rev_timestamp   TIMESTAMPTZ  NOT NULL,
   rev_minor_edit  CHAR         NOT NULL  DEFAULT '0',
-  rev_deleted     CHAR         NOT NULL  DEFAULT '0'
+  rev_deleted     CHAR         NOT NULL  DEFAULT '0',
+  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 28339f6..d2235f0 100644 (file)
@@ -270,6 +270,10 @@ CREATE TABLE /*$wgDBprefix*/revision (
   -- Not yet used; reserved for future changes to the deletion system.
   rev_deleted tinyint(1) unsigned NOT NULL default '0',
   
+  --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 99cd39c..efd4f51 100644 (file)
@@ -67,6 +67,7 @@ $wgNewFields = array(
        array( 'user',          'user_newpass_time','patch-user_newpass_time.sql' ),
        array( 'user',          'user_editcount',   'patch-user_editcount.sql' ),
        array( 'logging',       'log_id',               'patch-log_id.sql' ),
+       array( 'revision',      'rev_parent_id',    'patch-rev_parent_id.sql' ),
 );
 
 function rename_table( $from, $to, $patch ) {
@@ -412,6 +413,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),