Index: trunk/phase3/maintenance/archives/patch-log_deleted.sql |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +-- Adding ar_deleted field for revisiondelete
|
| 3 | +ALTER TABLE /*$wgDBprefix*/logging
|
| 4 | + ADD log_deleted tinyint(1) unsigned NOT NULL default '0'; |
\ No newline at end of file |
Index: trunk/phase3/maintenance/archives/patch-ar_deleted.sql |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +-- Adding ar_deleted field for revisiondelete
|
| 3 | +ALTER TABLE /*$wgDBprefix*/archive
|
| 4 | + ADD ar_deleted tinyint(1) unsigned NOT NULL default '0'; |
\ No newline at end of file |
Index: trunk/phase3/maintenance/archives/patch-fa_deleted.sql |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +-- Adding fa_deleted field for additional content suppression
|
| 3 | +ALTER TABLE /*$wgDBprefix*/filearchive
|
| 4 | + ADD fa_deleted tinyint(1) unsigned NOT NULL default '0'; |
\ No newline at end of file |
Index: trunk/phase3/maintenance/archives/patch-rc_deleted.sql |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +-- Adding rc_deleted field for revisiondelete
|
| 3 | +-- Add rc_logid to match log_id
|
| 4 | +ALTER TABLE /*$wgDBprefix*/recentchanges
|
| 5 | + ADD rc_deleted tinyint(1) unsigned NOT NULL default '0',
|
| 6 | + ADD rc_logid int(10) unsigned NOT NULL default '0',
|
| 7 | + ADD rc_log_type varchar(255) binary NULL default NULL,
|
| 8 | + ADD rc_log_action varchar(255) binary NULL default NULL,
|
| 9 | + ADD rc_params blob NOT NULL default '', |
\ No newline at end of file |
Index: trunk/phase3/maintenance/archives/patch-ipb_deleted.sql |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +-- Adding ipb_deleted field for hiding usernames
|
| 3 | +ALTER TABLE /*$wgDBprefix*/ipblocks
|
| 4 | + ADD ipb_deleted bool NOT NULL default 0; |
\ No newline at end of file |
Index: trunk/phase3/maintenance/postgres/tables.sql |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | |
115 | 115 | CREATE SEQUENCE pr_id_val; |
116 | 116 | CREATE TABLE page_restrictions ( |
117 | | - pr_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('pr_id_val'), |
| 117 | + pr_id INTEGER NOT NULL UNIQUE DEFAULT nextval('pr_id_val'), |
118 | 118 | pr_page INTEGER NULL REFERENCES page (page_id) ON DELETE CASCADE, |
119 | 119 | pr_type TEXT NOT NULL, |
120 | 120 | pr_level TEXT NOT NULL, |
— | — | @@ -135,7 +135,8 @@ |
136 | 136 | ar_minor_edit CHAR NOT NULL DEFAULT '0', |
137 | 137 | ar_flags TEXT, |
138 | 138 | ar_rev_id INTEGER, |
139 | | - ar_text_id INTEGER |
| 139 | + ar_text_id INTEGER, |
| 140 | + ar_deleted INTEGER NOT NULL DEFAULT '0', |
140 | 141 | ); |
141 | 142 | CREATE INDEX archive_name_title_timestamp ON archive2 (ar_namespace,ar_title,ar_timestamp); |
142 | 143 | |
— | — | @@ -246,6 +247,7 @@ |
247 | 248 | ipb_expiry TIMESTAMPTZ NOT NULL, |
248 | 249 | ipb_range_start TEXT, |
249 | 250 | ipb_range_end TEXT |
| 251 | + ipb_deleted INTEGER NOT NULL, DEFAULT '0', |
250 | 252 | ); |
251 | 253 | CREATE INDEX ipb_address ON ipblocks (ipb_address); |
252 | 254 | CREATE INDEX ipb_user ON ipblocks (ipb_user); |
— | — | @@ -306,6 +308,7 @@ |
307 | 309 | fa_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, |
308 | 310 | fa_user_text TEXT NOT NULL, |
309 | 311 | fa_timestamp TIMESTAMPTZ |
| 312 | + fa_deleted INTEGER NOT NULL DEFAULT '0', |
310 | 313 | ); |
311 | 314 | CREATE INDEX fa_name_time ON filearchive (fa_name, fa_timestamp); |
312 | 315 | CREATE INDEX fa_dupe ON filearchive (fa_storage_group, fa_storage_key); |
— | — | @@ -335,7 +338,12 @@ |
336 | 339 | rc_patrolled CHAR NOT NULL DEFAULT '0', |
337 | 340 | rc_ip CIDR, |
338 | 341 | rc_old_len INTEGER, |
339 | | - rc_new_len INTEGER |
| 342 | + rc_new_len INTEGER, |
| 343 | + rc_deleted INTEGER NOT NULL DEFAULT '0', |
| 344 | + rc_logid INTEGER NOT NULL DEFAULT '0', |
| 345 | + rc_log_type TEXT, |
| 346 | + rc_log_action TEXT, |
| 347 | + rc_params TEXT, |
340 | 348 | ); |
341 | 349 | CREATE INDEX rc_timestamp ON recentchanges (rc_timestamp); |
342 | 350 | CREATE INDEX rc_namespace_title ON recentchanges (rc_namespace, rc_title); |
— | — | @@ -410,6 +418,7 @@ |
411 | 419 | ); |
412 | 420 | |
413 | 421 | |
| 422 | +CREATE SEQUENCE log_log_id_seq; |
414 | 423 | CREATE TABLE logging ( |
415 | 424 | log_type TEXT NOT NULL, |
416 | 425 | log_action TEXT NOT NULL, |
— | — | @@ -418,7 +427,9 @@ |
419 | 428 | log_namespace SMALLINT NOT NULL, |
420 | 429 | log_title TEXT NOT NULL, |
421 | 430 | log_comment TEXT, |
422 | | - log_params TEXT |
| 431 | + log_params TEXT, |
| 432 | + log_deleted INTEGER NOT NULL DEFAULT '0', |
| 433 | + log_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('log_log_id_seq'), |
423 | 434 | ); |
424 | 435 | CREATE INDEX logging_type_name ON logging (log_type, log_timestamp); |
425 | 436 | CREATE INDEX logging_user_time ON logging (log_timestamp, log_user); |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -63,10 +63,15 @@ |
64 | 64 | array( 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ), |
65 | 65 | array( 'site_stats', 'ss_images', 'patch-ss_images.sql' ), |
66 | 66 | array( 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ), |
67 | | - array( 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ), |
| 67 | + array( 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ), |
68 | 68 | array( 'user', 'user_newpass_time','patch-user_newpass_time.sql' ), |
69 | 69 | array( 'user', 'user_editcount', 'patch-user_editcount.sql' ), |
70 | | - array( 'logging', 'log_id', 'patch-log_id.sql' ), |
| 70 | + array( 'recentchanges', 'rc_deleted', 'patch-rc_deleted.sql' ), |
| 71 | + array( 'logging', 'log_id', 'patch-log_id.sql' ), |
| 72 | + array( 'logging', 'log_deleted', 'patch-log_deleted.sql' ), |
| 73 | + array( 'archive', 'ar_deleted', 'patch-ar_deleted.sql' ), |
| 74 | + array( 'ipblocks', 'ipb_deleted', 'patch-ipb_deleted.sql' ), |
| 75 | + array( 'filearchive', 'fa_deleted', 'patch-fa_deleted.sql' ), |
71 | 76 | array( 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ), |
72 | 77 | array( 'revision', 'rev_len', 'patch-rev_len.sql' ), |
73 | 78 | array( 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ), |
Index: trunk/phase3/maintenance/mysql5/tables.sql |
— | — | @@ -383,6 +383,9 @@ |
384 | 384 | -- row upon undeletion. |
385 | 385 | ar_text_id int(8) unsigned, |
386 | 386 | |
| 387 | + -- rev_deleted for archives |
| 388 | + ar_deleted tinyint(1) unsigned NOT NULL default '0', |
| 389 | + |
387 | 390 | KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp) |
388 | 391 | |
389 | 392 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
— | — | @@ -625,6 +628,8 @@ |
626 | 629 | -- Size chosen to allow IPv6 |
627 | 630 | ipb_range_start tinyblob NOT NULL, |
628 | 631 | ipb_range_end tinyblob NOT NULL, |
| 632 | + -- Flag for entries hidden from users and Sysops |
| 633 | + ipb_deleted bool NOT NULL default 0, |
629 | 634 | |
630 | 635 | PRIMARY KEY ipb_id (ipb_id), |
631 | 636 | |
— | — | @@ -753,6 +758,9 @@ |
754 | 759 | fa_deleted_timestamp char(14) binary default '', |
755 | 760 | fa_deleted_reason text, |
756 | 761 | |
| 762 | + -- Visibility of deleted revisions, bitfield |
| 763 | + fa_deleted tinyint(1) unsigned NOT NULL default '0', |
| 764 | + |
757 | 765 | -- Duped fields from image |
758 | 766 | fa_size int(8) unsigned default '0', |
759 | 767 | fa_width int(5) default '0', |
— | — | @@ -829,12 +837,24 @@ |
830 | 838 | -- Recorded IP address the edit was made from, if the |
831 | 839 | -- $wgPutIPinRC option is enabled. |
832 | 840 | rc_ip char(15) NOT NULL default '', |
833 | | - |
| 841 | + |
834 | 842 | -- Text length in characters before |
835 | 843 | -- and after the edit |
836 | 844 | rc_old_len int(10), |
837 | 845 | rc_new_len int(10), |
838 | 846 | |
| 847 | + -- Visibility of deleted revisions, bitfield |
| 848 | + rc_deleted tinyint(1) unsigned NOT NULL default '0', |
| 849 | + |
| 850 | + -- Value corresonding to log_id, specific log entries |
| 851 | + rc_logid int(10) unsigned NOT NULL default '0', |
| 852 | + -- Store log type info here, or null |
| 853 | + rc_log_type varchar(255) binary NULL default NULL, |
| 854 | + -- Store log action or null |
| 855 | + rc_log_action varchar(255) binary NULL default NULL, |
| 856 | + -- Log params |
| 857 | + rc_params blob NOT NULL default '', |
| 858 | + |
839 | 859 | PRIMARY KEY rc_id (rc_id), |
840 | 860 | INDEX rc_timestamp (rc_timestamp), |
841 | 861 | INDEX rc_namespace_title (rc_namespace, rc_title), |
— | — | @@ -1006,6 +1026,9 @@ |
1007 | 1027 | KEY user_time (log_user, log_timestamp), |
1008 | 1028 | KEY page_time (log_namespace, log_title, log_timestamp), |
1009 | 1029 | KEY times (log_timestamp) |
| 1030 | + |
| 1031 | + -- rev_deleted for logs |
| 1032 | + log_deleted tinyint(1) unsigned NOT NULL default '0', |
1010 | 1033 | |
1011 | 1034 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
1012 | 1035 | |
Index: trunk/phase3/maintenance/mysql5/tables-binary.sql |
— | — | @@ -392,6 +392,9 @@ |
393 | 393 | -- row upon undeletion. |
394 | 394 | ar_text_id int(8) unsigned, |
395 | 395 | |
| 396 | + -- rev_deleted for archives |
| 397 | + ar_deleted tinyint(1) unsigned NOT NULL default '0', |
| 398 | + |
396 | 399 | KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp) |
397 | 400 | |
398 | 401 | ) ENGINE=InnoDB, DEFAULT CHARSET=binary; |
— | — | @@ -634,6 +637,8 @@ |
635 | 638 | -- Size chosen to allow IPv6 |
636 | 639 | ipb_range_start tinyblob NOT NULL, |
637 | 640 | ipb_range_end tinyblob NOT NULL, |
| 641 | + -- Flag for entries hidden from users and Sysops |
| 642 | + ipb_deleted bool NOT NULL default 0, |
638 | 643 | |
639 | 644 | PRIMARY KEY ipb_id (ipb_id), |
640 | 645 | |
— | — | @@ -776,6 +781,9 @@ |
777 | 782 | fa_user_text varchar(255) binary, |
778 | 783 | fa_timestamp char(14) binary default '', |
779 | 784 | |
| 785 | + -- Visibility of deleted revisions, bitfield |
| 786 | + fa_deleted tinyint(1) unsigned NOT NULL default '0', |
| 787 | + |
780 | 788 | PRIMARY KEY (fa_id), |
781 | 789 | INDEX (fa_name, fa_timestamp), -- pick out by image name |
782 | 790 | INDEX (fa_storage_group, fa_storage_key), -- pick out dupe files |
— | — | @@ -844,6 +852,18 @@ |
845 | 853 | rc_old_len int(10), |
846 | 854 | rc_new_len int(10), |
847 | 855 | |
| 856 | + -- Visibility of deleted revisions, bitfield |
| 857 | + rc_deleted tinyint(1) unsigned NOT NULL default '0', |
| 858 | + |
| 859 | + -- Value corresonding to log_id, specific log entries |
| 860 | + rc_logid int(10) unsigned NOT NULL default '0', |
| 861 | + -- Store log type info here, or null |
| 862 | + rc_log_type varchar(255) binary NULL default NULL, |
| 863 | + -- Store log action or null |
| 864 | + rc_log_action varchar(255) binary NULL default NULL, |
| 865 | + -- Log params |
| 866 | + rc_params blob NOT NULL default '', |
| 867 | + |
848 | 868 | PRIMARY KEY rc_id (rc_id), |
849 | 869 | INDEX rc_timestamp (rc_timestamp), |
850 | 870 | INDEX rc_namespace_title (rc_namespace, rc_title), |
— | — | @@ -1010,6 +1030,9 @@ |
1011 | 1031 | |
1012 | 1032 | -- LF separated list of miscellaneous parameters |
1013 | 1033 | log_params blob NOT NULL, |
| 1034 | + |
| 1035 | + -- rev_deleted for logs |
| 1036 | + log_deleted tinyint(1) unsigned NOT NULL default '0', |
1014 | 1037 | |
1015 | 1038 | KEY type_time (log_type, log_timestamp), |
1016 | 1039 | KEY user_time (log_user, log_timestamp), |
Index: branches/phase3_rev_deleted/maintenance/tables.sql |
— | — | @@ -813,8 +813,10 @@ |
814 | 814 | rc_logid int(10) unsigned NOT NULL default '0', |
815 | 815 | -- Store log type info here, or null |
816 | 816 | rc_log_type varchar(255) binary NULL default NULL, |
817 | | - -- The action text of logs |
818 | | - rc_actiontext varchar(255) binary NULL default NULL, |
| 817 | + -- Store log action or null |
| 818 | + rc_log_action varchar(255) binary NULL default NULL, |
| 819 | + -- Log params |
| 820 | + rc_params blob NOT NULL default '', |
819 | 821 | |
820 | 822 | PRIMARY KEY rc_id (rc_id), |
821 | 823 | INDEX rc_timestamp (rc_timestamp), |