summaryrefslogtreecommitdiff
path: root/maintenance/sqlite/archives/patch-cat_hidden.sql
blob: 272b8ef3d5441268df11f0540b05f8ec3b8bd3bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- cat_hidden is no longer used, delete it

CREATE TABLE /*_*/category_tmp (
  cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
  cat_title varchar(255) binary NOT NULL,
  cat_pages int signed NOT NULL default 0,
  cat_subcats int signed NOT NULL default 0,
  cat_files int signed NOT NULL default 0
) /*$wgDBTableOptions*/;

INSERT INTO /*_*/category_tmp
	SELECT cat_id, cat_title, cat_pages, cat_subcats, cat_files
		FROM /*_*/category;

DROP TABLE /*_*/category;

ALTER TABLE /*_*/category_tmp RENAME TO /*_*/category;

CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title);
CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages);