summaryrefslogtreecommitdiff
path: root/maintenance/sqlite/archives/patch-drop-ss_total_views.sql
blob: ad80988dc0ddd89b6ecf51cdd437887d8e7159e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- field is deprecated and no longer updated as of 1.25
CREATE TABLE /*_*/site_stats_tmp (
  ss_row_id int unsigned NOT NULL,
  ss_total_edits bigint unsigned default 0,
  ss_good_articles bigint unsigned default 0,
  ss_total_pages bigint default '-1',
  ss_users bigint default '-1',
  ss_active_users bigint default '-1',
  ss_images int default 0
) /*$wgDBTableOptions*/;

INSERT INTO /*_*/site_stats_tmp
  SELECT ss_row_id, ss_total_edits, ss_good_articles, ss_total_pages,
    ss_users, ss_active_users, ss_images
  FROM /*_*/site_stats;

DROP TABLE /*_*/site_stats;

ALTER TABLE /*_*/site_stats_tmp RENAME TO /*_*/site_stats;

CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);