--- /dev/null
+-- Adding ar_deleted field for revisiondelete\r
+ALTER TABLE /*$wgDBprefix*/archive\r
+ ADD ar_deleted tinyint(1) unsigned NOT NULL default '0';
\ No newline at end of file
--- /dev/null
+-- Adding fa_deleted field for additional content suppression\r
+ALTER TABLE /*$wgDBprefix*/filearchive \r
+ ADD fa_deleted tinyint(1) unsigned NOT NULL default '0';
\ No newline at end of file
--- /dev/null
+-- Adding ipb_deleted field for hiding usernames\r
+ALTER TABLE /*$wgDBprefix*/ipblocks \r
+ ADD ipb_deleted bool NOT NULL default 0;
\ No newline at end of file
--- /dev/null
+-- Adding ar_deleted field for revisiondelete\r
+ALTER TABLE /*$wgDBprefix*/logging\r
+ ADD log_deleted tinyint(1) unsigned NOT NULL default '0';
\ No newline at end of file
--- /dev/null
+-- Adding rc_deleted field for revisiondelete\r
+-- Add rc_logid to match log_id\r
+ALTER TABLE /*$wgDBprefix*/recentchanges \r
+ ADD rc_deleted tinyint(1) unsigned NOT NULL default '0',\r
+ ADD rc_logid int(10) unsigned NOT NULL default '0',\r
+ ADD rc_log_type varchar(255) binary NULL default NULL,\r
+ ADD rc_log_action varchar(255) binary NULL default NULL,\r
+ ADD rc_params blob NOT NULL default '',
\ No newline at end of file
-- row upon undeletion.
ar_text_id int(8) unsigned,
+ -- rev_deleted for archives
+ ar_deleted tinyint(1) unsigned NOT NULL default '0',
+
KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp)
) ENGINE=InnoDB, DEFAULT CHARSET=binary;
-- Size chosen to allow IPv6
ipb_range_start tinyblob NOT NULL,
ipb_range_end tinyblob NOT NULL,
+ -- Flag for entries hidden from users and Sysops
+ ipb_deleted bool NOT NULL default 0,
PRIMARY KEY ipb_id (ipb_id),
fa_user_text varchar(255) binary,
fa_timestamp char(14) binary default '',
+ -- Visibility of deleted revisions, bitfield
+ fa_deleted tinyint(1) unsigned NOT NULL default '0',
+
PRIMARY KEY (fa_id),
INDEX (fa_name, fa_timestamp), -- pick out by image name
INDEX (fa_storage_group, fa_storage_key), -- pick out dupe files
rc_old_len int(10),
rc_new_len int(10),
+ -- Visibility of deleted revisions, bitfield
+ rc_deleted tinyint(1) unsigned NOT NULL default '0',
+
+ -- Value corresonding to log_id, specific log entries
+ rc_logid int(10) unsigned NOT NULL default '0',
+ -- Store log type info here, or null
+ rc_log_type varchar(255) binary NULL default NULL,
+ -- Store log action or null
+ rc_log_action varchar(255) binary NULL default NULL,
+ -- Log params
+ rc_params blob NOT NULL default '',
+
PRIMARY KEY rc_id (rc_id),
INDEX rc_timestamp (rc_timestamp),
INDEX rc_namespace_title (rc_namespace, rc_title),
-- LF separated list of miscellaneous parameters
log_params blob NOT NULL,
+
+ -- rev_deleted for logs
+ log_deleted tinyint(1) unsigned NOT NULL default '0',
KEY type_time (log_type, log_timestamp),
KEY user_time (log_user, log_timestamp),
-- row upon undeletion.
ar_text_id int(8) unsigned,
+ -- rev_deleted for archives
+ ar_deleted tinyint(1) unsigned NOT NULL default '0',
+
KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp)
) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
-- Size chosen to allow IPv6
ipb_range_start tinyblob NOT NULL,
ipb_range_end tinyblob NOT NULL,
+ -- Flag for entries hidden from users and Sysops
+ ipb_deleted bool NOT NULL default 0,
PRIMARY KEY ipb_id (ipb_id),
fa_deleted_timestamp char(14) binary default '',
fa_deleted_reason text,
+ -- Visibility of deleted revisions, bitfield
+ fa_deleted tinyint(1) unsigned NOT NULL default '0',
+
-- Duped fields from image
fa_size int(8) unsigned default '0',
fa_width int(5) default '0',
-- Recorded IP address the edit was made from, if the
-- $wgPutIPinRC option is enabled.
rc_ip char(15) NOT NULL default '',
-
+
-- Text length in characters before
-- and after the edit
rc_old_len int(10),
rc_new_len int(10),
+ -- Visibility of deleted revisions, bitfield
+ rc_deleted tinyint(1) unsigned NOT NULL default '0',
+
+ -- Value corresonding to log_id, specific log entries
+ rc_logid int(10) unsigned NOT NULL default '0',
+ -- Store log type info here, or null
+ rc_log_type varchar(255) binary NULL default NULL,
+ -- Store log action or null
+ rc_log_action varchar(255) binary NULL default NULL,
+ -- Log params
+ rc_params blob NOT NULL default '',
+
PRIMARY KEY rc_id (rc_id),
INDEX rc_timestamp (rc_timestamp),
INDEX rc_namespace_title (rc_namespace, rc_title),
KEY user_time (log_user, log_timestamp),
KEY page_time (log_namespace, log_title, log_timestamp),
KEY times (log_timestamp)
+
+ -- rev_deleted for logs
+ log_deleted tinyint(1) unsigned NOT NULL default '0',
) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
CREATE SEQUENCE pr_id_val;
CREATE TABLE page_restrictions (
- pr_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('pr_id_val'),
+ pr_id INTEGER NOT NULL UNIQUE DEFAULT nextval('pr_id_val'),
pr_page INTEGER NULL REFERENCES page (page_id) ON DELETE CASCADE,
pr_type TEXT NOT NULL,
pr_level TEXT NOT NULL,
ar_minor_edit CHAR NOT NULL DEFAULT '0',
ar_flags TEXT,
ar_rev_id INTEGER,
- ar_text_id INTEGER
+ ar_text_id INTEGER,
+ ar_deleted INTEGER NOT NULL DEFAULT '0',
);
CREATE INDEX archive_name_title_timestamp ON archive2 (ar_namespace,ar_title,ar_timestamp);
ipb_expiry TIMESTAMPTZ NOT NULL,
ipb_range_start TEXT,
ipb_range_end TEXT
+ ipb_deleted INTEGER NOT NULL, DEFAULT '0',
);
CREATE INDEX ipb_address ON ipblocks (ipb_address);
CREATE INDEX ipb_user ON ipblocks (ipb_user);
fa_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL,
fa_user_text TEXT NOT NULL,
fa_timestamp TIMESTAMPTZ
+ fa_deleted INTEGER NOT NULL DEFAULT '0',
);
CREATE INDEX fa_name_time ON filearchive (fa_name, fa_timestamp);
CREATE INDEX fa_dupe ON filearchive (fa_storage_group, fa_storage_key);
rc_patrolled CHAR NOT NULL DEFAULT '0',
rc_ip CIDR,
rc_old_len INTEGER,
- rc_new_len INTEGER
+ rc_new_len INTEGER,
+ rc_deleted INTEGER NOT NULL DEFAULT '0',
+ rc_logid INTEGER NOT NULL DEFAULT '0',
+ rc_log_type TEXT,
+ rc_log_action TEXT,
+ rc_params TEXT,
);
CREATE INDEX rc_timestamp ON recentchanges (rc_timestamp);
CREATE INDEX rc_namespace_title ON recentchanges (rc_namespace, rc_title);
);
+CREATE SEQUENCE log_log_id_seq;
CREATE TABLE logging (
log_type TEXT NOT NULL,
log_action TEXT NOT NULL,
log_namespace SMALLINT NOT NULL,
log_title TEXT NOT NULL,
log_comment TEXT,
- log_params TEXT
+ log_params TEXT,
+ log_deleted INTEGER NOT NULL DEFAULT '0',
+ log_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('log_log_id_seq'),
);
CREATE INDEX logging_type_name ON logging (log_type, log_timestamp);
CREATE INDEX logging_user_time ON logging (log_timestamp, log_user);
array( 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ),
array( 'site_stats', 'ss_images', 'patch-ss_images.sql' ),
array( 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ),
- array( 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
+ array( 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
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( 'recentchanges', 'rc_deleted', 'patch-rc_deleted.sql' ),
+ array( 'logging', 'log_id', 'patch-log_id.sql' ),
+ array( 'logging', 'log_deleted', 'patch-log_deleted.sql' ),
+ array( 'archive', 'ar_deleted', 'patch-ar_deleted.sql' ),
+ array( 'ipblocks', 'ipb_deleted', 'patch-ipb_deleted.sql' ),
+ array( 'filearchive', 'fa_deleted', 'patch-fa_deleted.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' ),