PostgreSQL: Add missing columns for AbuseFilter

Change I758795f01eaf3ff56c5720d660cd989ef95764a7, first released
in 1.20, added columns to AbuseFilter tables for MySQL, but not for
PostgreSQL.

This adds those columns for PostgreSQL, both for the installer and
for the updater.

Combined with already-merged change 192002, this change closes
bug T89514.

Bug: T89514
Change-Id: Ie33a5a932ffd85fa8a4111b949bd0a4d07a2af91
This commit is contained in:
Jeff Janes 2015-02-20 10:25:55 -08:00 committed by Matěj Suchánek
parent 8d40f43a50
commit d7fccb57ed
2 changed files with 13 additions and 2 deletions

View file

@ -21,9 +21,11 @@ CREATE TABLE abuse_filter (
af_throttled SMALLINT NOT NULL DEFAULT 0,
af_deleted SMALLINT NOT NULL DEFAULT 0,
af_actions TEXT NOT NULL DEFAULT '',
af_global SMALLINT NOT NULL DEFAULT 0
af_global SMALLINT NOT NULL DEFAULT 0,
af_group TEXT NOT NULL DEFAULT 'default'
);
CREATE INDEX abuse_filter_user ON abuse_filter(af_user);
CREATE INDEX abuse_filter_group_enabled_id ON abuse_filter(af_group,af_enabled,af_id);
CREATE TABLE abuse_filter_action (
@ -72,7 +74,8 @@ CREATE TABLE abuse_filter_history (
afh_public_comments TEXT NOT NULL,
afh_actions TEXT NOT NULL,
afh_deleted SMALLINT NOT NULL DEFAULT 0,
afh_changed_fields TEXT NOT NULL DEFAULT ''
afh_changed_fields TEXT NOT NULL DEFAULT '',
afh_group TEXT NULL
);
CREATE INDEX abuse_filter_history_filter ON abuse_filter_history(afh_filter);
CREATE INDEX abuse_filter_history_user ON abuse_filter_history(afh_user);

View file

@ -603,6 +603,14 @@ class AbuseFilterHooks {
'addPgExtIndex', 'abuse_filter_log', 'abuse_filter_log_wiki', "(afl_wiki)" ] );
$updater->addExtensionUpdate( [
'changeField', 'abuse_filter_log', 'afl_namespace', "INTEGER", '' ] );
$updater->addExtensionUpdate( [
'addPgField', 'abuse_filter', 'af_group', "TEXT NOT NULL DEFAULT 'default'" ] );
$updater->addExtensionUpdate( [
'addPgExtIndex', 'abuse_filter', 'abuse_filter_group_enabled_id',
"(af_group, af_enabled, af_id)"
] );
$updater->addExtensionUpdate( [
'addPgField', 'abuse_filter_history', 'afh_group', "TEXT" ] );
}
$updater->addExtensionUpdate( [ [ __CLASS__, 'createAbuseFilterUser' ] ] );