Index: trunk/wikistats/analytics/create_and_use_db_analytics.txt |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | -- only store basic data in database and calculate all aggregates on the fly or do some aggragation before hand ? (e.g. count for mobile / non-mobile / ==> total of both ? <==) |
20 | 20 | -- for binaries, store one extension type per row? (future proof, more work to query), or a selected few as columns? (one row only needed per month) |
21 | 21 | |
| 22 | +-- Create database and tables from scratch |
22 | 23 | DROP DATABASE IF EXISTS `analytics` ; |
23 | 24 | |
24 | 25 | CREATE DATABASE `analytics` ; |
— | — | @@ -97,6 +97,12 @@ |
98 | 98 | PRIMARY KEY (date,project_code,language_code,extension) |
99 | 99 | ) ; |
100 | 100 | |
| 101 | +CREATE TABLE `offline` ( |
| 102 | + `date` date NOT NULL, |
| 103 | + `readers` bigint(12) NOT NULL DEFAULT '0', |
| 104 | + PRIMARY KEY (date,readers) |
| 105 | +) ; |
| 106 | + |
101 | 107 | -- SHOW TABLES ; |
102 | 108 | -- DESCRIBE comscore ; |
103 | 109 | -- DESCRIBE comscore_regions ; |