]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - maintenance/sqlite/archives/patch-site_stats-fix-pk.sql
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / maintenance / sqlite / archives / patch-site_stats-fix-pk.sql
1 CREATE TABLE /*_*/site_stats_tmp (
2   -- The single row should contain 1 here.
3   ss_row_id int unsigned NOT NULL PRIMARY KEY,
4
5   -- Total number of edits performed.
6   ss_total_edits bigint unsigned default 0,
7
8   -- An approximate count of pages matching the following criteria:
9   -- * in namespace 0
10   -- * not a redirect
11   -- * contains the text '[['
12   -- See Article::isCountable() in includes/Article.php
13   ss_good_articles bigint unsigned default 0,
14
15   -- Total pages, theoretically equal to SELECT COUNT(*) FROM page; except faster
16   ss_total_pages bigint default '-1',
17
18   -- Number of users, theoretically equal to SELECT COUNT(*) FROM user;
19   ss_users bigint default '-1',
20
21   -- Number of users that still edit
22   ss_active_users bigint default '-1',
23
24   -- Number of images, equivalent to SELECT COUNT(*) FROM image
25   ss_images int default 0
26 ) /*$wgDBTableOptions*/;
27
28 INSERT INTO /*_*/site_stats_tmp
29         SELECT * FROM /*_*/site_stats;
30
31 DROP TABLE /*_*/site_stats;
32
33 ALTER TABLE /*_*/site_stats_tmp RENAME TO /*_*/site_stats;