r49680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49679‎ | r49680 | r49681 >
Date:22:45, 20 April 2009
Author:greg
Status:ok
Tags:
Comment:
Postgres schema updates, per request at ticket 18537.
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.hooks.php (modified) (history)
  • /trunk/extensions/AbuseFilter/abusefilter.tables.pg.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/abusefilter.tables.pg.sql
@@ -16,7 +16,8 @@
1717 af_hit_count INTEGER NOT NULL DEFAULT 0,
1818 af_throttled SMALLINT NOT NULL DEFAULT 0,
1919 af_deleted SMALLINT NOT NULL DEFAULT 0,
20 - af_actions TEXT NOT NULL DEFAULT ''
 20+ af_actions TEXT NOT NULL DEFAULT '',
 21+ af_global SMALLINT NOT NULL DEFAULT 0
2122 );
2223 CREATE INDEX abuse_filter_user ON abuse_filter(af_user);
2324
@@ -33,7 +34,7 @@
3435 CREATE SEQUENCE abuse_filter_log_afl_id_seq;
3536 CREATE TABLE abuse_filter_log (
3637 afl_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('abuse_filter_log_afl_id_seq'),
37 - afl_filter INTEGER NOT NULL,
 38+ afl_filter TEXT NOT NULL,
3839 afl_user INTEGER NOT NULL,
3940 afl_user_text TEXT NOT NULL,
4041 afl_ip TEXT NOT NULL,
@@ -42,7 +43,9 @@
4344 afl_var_dump TEXT NOT NULL,
4445 afl_timestamp TIMESTAMPTZ NOT NULL,
4546 afl_namespace SMALLINT NOT NULL,
46 - afl_title TEXT NOT NULL
 47+ afl_title TEXT NOT NULL,
 48+ afl_wiki TEXT NULL,
 49+ afl_deleted SMALLINT NULL
4750 );
4851 CREATE INDEX abuse_filter_log_filter ON abuse_filter_log(afl_filter);
4952 CREATE INDEX abuse_filter_log_ip ON abuse_filter_log(afl_ip);
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php
@@ -151,7 +151,7 @@
152152 }
153153
154154 public static function onLoadExtensionSchemaUpdates() {
155 - global $wgExtNewTables, $wgExtNewFields, $wgExtPGNewFields, $wgExtNewIndexes, $wgDBtype;
 155+ global $wgExtNewTables, $wgExtNewFields, $wgExtPGNewFields, $wgExtPGAlteredFields, $wgExtNewIndexes, $wgDBtype;
156156
157157 $dir = dirname( __FILE__ );
158158
@@ -169,8 +169,14 @@
170170 array( 'abuse_filter', "$dir/abusefilter.tables.pg.sql" ),
171171 array( 'abuse_filter_history', "$dir/db_patches/patch-abuse_filter_history.pg.sql" ),
172172 ) );
173 - $wgExtPGNewFields[] = array('abuse_filter', 'af_deleted', "SMALLINT NOT NULL DEFAULT 0" );
174173 $wgExtPGNewFields[] = array('abuse_filter', 'af_actions', "TEXT NOT NULL DEFAULT ''" );
 174+ $wgExtPGNewFields[] = array('abuse_filter', 'af_deleted', 'SMALLINT NOT NULL DEFAULT 0' );
 175+ $wgExtPGNewFields[] = array('abuse_filter', 'af_global', 'SMALLINT NOT NULL DEFAULT 0' );
 176+
 177+ $wgExtPGNewFields[] = array('abuse_filter_log', 'afl_wiki', 'TEXT' );
 178+ $wgExtPGNewFields[] = array('abuse_filter_log', 'afl_deleted', 'SMALLINT' );
 179+ $wgExtPGAlteredFields[] = array('abuse_filter_log', 'afl_filter', 'TEXT' );
 180+
175181 $wgExtNewIndexes[] = array('abuse_filter_log', 'abuse_filter_log_ip', "(afl_ip)");
176182 }
177183 return true;

Status & tagging log