Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / maintenance / sqlite / archives / patch-protected_titles-drop-pt_reason.sql
1 --
2 -- patch-protected_titles-drop-pt_reason.sql
3 --
4 -- T166732. Drop old xx_comment fields, and defaults from xx_comment_id fields.
5
6 BEGIN;
7
8 DROP TABLE IF EXISTS /*_*/protected_titles_tmp;
9 CREATE TABLE /*_*/protected_titles_tmp (
10 pt_namespace int NOT NULL,
11 pt_title varchar(255) binary NOT NULL,
12 pt_user int unsigned NOT NULL,
13 pt_reason_id bigint unsigned NOT NULL,
14 pt_timestamp binary(14) NOT NULL,
15 pt_expiry varbinary(14) NOT NULL default '',
16 pt_create_perm varbinary(60) NOT NULL,
17 PRIMARY KEY (pt_namespace,pt_title)
18 ) /*$wgDBTableOptions*/;
19
20 INSERT OR IGNORE INTO /*_*/protected_titles_tmp (
21 pt_namespace, pt_title, pt_user, pt_reason_id, pt_timestamp, pt_expiry, pt_create_perm
22 ) SELECT
23 pt_namespace, pt_title, pt_user, pt_reason_id, pt_timestamp, pt_expiry, pt_create_perm
24 FROM /*_*/protected_titles;
25
26 DROP TABLE /*_*/protected_titles;
27 ALTER TABLE /*_*/protected_titles_tmp RENAME TO /*_*/protected_titles;
28 CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);
29
30 COMMIT;