Merge ".pipeline/config.yaml: rename dev stage to publish"
[lhc/web/wiklou.git] / maintenance / sqlite / archives / patch-protected_titles-pt_reason_id.sql
1 BEGIN;
2
3 DROP TABLE IF EXISTS /*_*/protected_titles_tmp;
4 CREATE TABLE /*_*/protected_titles_tmp (
5 pt_namespace int NOT NULL,
6 pt_title varchar(255) binary NOT NULL,
7 pt_user int unsigned NOT NULL,
8 pt_reason varbinary(767) default '',
9 pt_reason_id bigint unsigned NOT NULL DEFAULT 0,
10 pt_timestamp binary(14) NOT NULL,
11 pt_expiry varbinary(14) NOT NULL default '',
12 pt_create_perm varbinary(60) NOT NULL
13 ) /*$wgDBTableOptions*/;
14
15 INSERT OR IGNORE INTO /*_*/protected_titles_tmp (
16 pt_namespace, pt_title, pt_user, pt_reason, pt_timestamp, pt_expiry, pt_create_perm)
17 SELECT
18 pt_namespace, pt_title, pt_user, pt_reason, pt_timestamp, pt_expiry, pt_create_perm
19 FROM /*_*/protected_titles;
20
21 DROP TABLE /*_*/protected_titles;
22 ALTER TABLE /*_*/protected_titles_tmp RENAME TO /*_*/protected_titles;
23 CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title);
24 CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);
25
26 COMMIT;