Overhaul site_stats table
authorEddie Greiner-Petter <git@eddie-sh.de>
Mon, 8 May 2017 19:31:54 +0000 (21:31 +0200)
committerKrinkle <krinklemail@gmail.com>
Mon, 26 Mar 2018 23:51:40 +0000 (23:51 +0000)
commit27c76fa4ae07b6a1404bad269698d1af2679cc43
tree895bf365613ff7749f33335591470e774cc77ba3
parentabeca9ac48415828428284816d76dee347e680ea
Overhaul site_stats table

The site stats table holds a bunch of metric fields, two of which are of
data type "bigint unsigned", 3 are "bigint" (signed) and one is int
(signed).  Also the default values differ widely: It is 0 on the
"unsigned" fields and the "int" field, but -1 on the three others. This
patch makes all of this more consistent:

Set all fields (except the ss_row_id, which isn't changed) data type to
"bigint unsigned". Also set NULL as the default value for all those
fields. Obviously -1 isn't a possible default value any more. Also, 0
can easily be mistaken for a real value (e.g. ss_active_users=0 -->
"there is nobody active on this wiki"). NULL, by it's definition, is the
value of choice for a value to insert into fields of which we don't know
a correct value.

The respective patch files were tested locally against MySql, Sqlite,
Postgres and SQL Server 2016. Neither oracle nor the upgrade with
update.php was tested.

Bug: T56888
Change-Id: I7d42aae434852a56b6f8dd559d8a5f3bce416021
14 files changed:
includes/installer/MssqlUpdater.php
includes/installer/MysqlUpdater.php
includes/installer/OracleUpdater.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteUpdater.php
maintenance/archives/patch-site_stats-modify.sql [new file with mode: 0644]
maintenance/mssql/archives/patch-site_stats-modify.sql [new file with mode: 0644]
maintenance/mssql/tables.sql
maintenance/oracle/archives/patch-site_stats-modify.sql [new file with mode: 0644]
maintenance/oracle/tables.sql
maintenance/postgres/archives/patch-site_stats-modify.sql [new file with mode: 0644]
maintenance/postgres/tables.sql
maintenance/sqlite/archives/patch-site_stats-modify.sql [new file with mode: 0644]
maintenance/tables.sql