wiki.techinc.nl/maintenance/postgres/archives
Eddie Greiner-Petter 27c76fa4ae 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
2018-03-26 23:51:40 +00:00
..
patch-actor-table.sql Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
patch-add_interwiki.sql
patch-bot_passwords.sql Revert "Remove SessionManager, temporarily" 2016-02-03 21:44:59 +00:00
patch-category.sql
patch-categorylinks-better-collation.sql
patch-change_tag.sql
patch-comment-table.sql Fix various PostgreSQL failures 2017-08-30 17:18:29 -04:00
patch-content-table.sql MCR database schema 2017-12-23 17:43:09 -05:00
patch-content_models-table.sql MCR database schema 2017-12-23 17:43:09 -05:00
patch-ip_changes.sql Remove DEFAULT '' from postgres ip_changes.ipc_rev_timestamp 2017-11-29 20:11:19 +00:00
patch-iwlinks.sql
patch-kill-iwl_prefix.sql
patch-l10n_cache.sql
patch-log_search.sql
patch-module_deps.sql
patch-page.sql
patch-page_deleted.sql
patch-page_props.sql
patch-page_restrictions.sql
patch-profiling.sql
patch-protected_titles.sql
patch-querycachetwo.sql
patch-rc_cur_id-not-null.sql
patch-redirect.sql
patch-remove-archive2.sql
patch-rename-iwl_prefix.sql
patch-revision_rev_user_fkey.sql
patch-site_stats-modify.sql Overhaul site_stats table 2018-03-26 23:51:40 +00:00
patch-site_stats-pk.sql Add primary keys to site_stats 2017-10-17 11:59:20 +00:00
patch-sites.sql
patch-slot_roles-table.sql MCR database schema 2017-12-23 17:43:09 -05:00
patch-slots-table.sql MCR: replace slot_inherited with slot_origin 2018-03-19 21:51:56 +01:00
patch-tag_summary.sql
patch-testrun.sql
patch-textsearch_bug66650.sql PostgreSQL: Fix text search on moved pages 2015-02-17 18:15:23 -08:00
patch-ts2pagetitle.sql
patch-tsearch2funcs.sql
patch-update_sequences.sql
patch-updatelog.sql
patch-uploadstash.sql
patch-uploadstash_sequence.sql
patch-user_former_groups.sql
patch-user_properties.sql
patch-valid_tag.sql