Fix SQLite patch-(page|template)links-fix-pk.sql column order
[lhc/web/wiklou.git] / maintenance / sqlite / archives / patch-protected_titles-fix-pk.sql
1 CREATE TABLE /*_*/protected_titles_tmp (
2 pt_namespace int NOT NULL,
3 pt_title varchar(255) binary NOT NULL,
4 pt_user int unsigned NOT NULL,
5 pt_reason varbinary(767) default '', -- Deprecated.
6 pt_reason_id bigint unsigned NOT NULL DEFAULT 0, -- ("DEFAULT 0" is temporary, signaling that pt_reason should be used)
7 pt_timestamp binary(14) NOT NULL,
8 pt_expiry varbinary(14) NOT NULL default '',
9 pt_create_perm varbinary(60) NOT NULL,
10
11 PRIMARY KEY (pt_namespace,pt_title)
12 ) /*$wgDBTableOptions*/;
13
14 INSERT INTO /*_*/protected_titles_tmp
15 SELECT * FROM /*_*/protected_titles;
16
17 DROP TABLE /*_*/protected_titles;
18
19 ALTER TABLE /*_*/protected_titles_tmp RENAME TO /*_*/protected_titles;
20
21 CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);