1 DROP TABLE IF EXISTS /*_*/archive_tmp;
3 CREATE TABLE /*$wgDBprefix*/archive_tmp (
4 ar_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
5 ar_namespace int NOT NULL default 0,
6 ar_title varchar(255) binary NOT NULL default '',
7 ar_text mediumblob NOT NULL,
8 ar_comment tinyblob NOT NULL,
9 ar_user int unsigned NOT NULL default 0,
10 ar_user_text varchar(255) binary NOT NULL,
11 ar_timestamp binary(14) NOT NULL default '',
12 ar_minor_edit tinyint NOT NULL default 0,
13 ar_flags tinyblob NOT NULL,
14 ar_rev_id int unsigned,
15 ar_text_id int unsigned,
16 ar_deleted tinyint unsigned NOT NULL default 0,
18 ar_page_id int unsigned,
19 ar_parent_id int unsigned default NULL,
20 ar_sha1 varbinary(32) NOT NULL default '',
21 ar_content_model varbinary(32) DEFAULT NULL,
22 ar_content_format varbinary(64) DEFAULT NULL
25 INSERT OR IGNORE INTO /*_*/archive_tmp (
26 ar_namespace, ar_title, ar_title, ar_text, ar_comment, ar_user, ar_user_text, ar_timestamp,
27 ar_minor_edit, ar_flags, ar_rev_id, ar_text_id, ar_deleted, ar_len, ar_page_id, ar_parent_id )
29 ar_namespace, ar_title, ar_title, ar_text, ar_comment, ar_user, ar_user_text, ar_timestamp,
30 ar_minor_edit, ar_flags, ar_rev_id, ar_text_id, ar_deleted, ar_len, ar_page_id, ar_parent_id
33 DROP TABLE /*_*/archive;
35 ALTER TABLE /*_*/archive_tmp RENAME TO /*_*/archive;
37 CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
38 CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
39 CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id);