mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 13:46:48 +00:00
Drop af_user(_text) and afh_user(_text) fields
They have been migrated to their respective _actor counterparts. Bug: T188180 Change-Id: I76ab3a4eeaf93bf009ba3a5d4a0315443b6839ef
This commit is contained in:
parent
a5afeff49c
commit
469d643530
194
db_patches/abstractSchemaChanges/patch-drop-af_user.json
Normal file
194
db_patches/abstractSchemaChanges/patch-drop-af_user.json
Normal file
|
@ -0,0 +1,194 @@
|
|||
{
|
||||
"comment": "Drop af_user and af_user_text fields from abuse_filter",
|
||||
"before": {
|
||||
"name": "abuse_filter",
|
||||
"columns": [
|
||||
{
|
||||
"name": "af_id",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "autoincrement": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "af_pattern",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "af_user",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_user_text",
|
||||
"type": "binary",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "af_actor",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_timestamp",
|
||||
"type": "mwtimestamp",
|
||||
"options": { "notnull": true }
|
||||
},
|
||||
{
|
||||
"name": "af_enabled",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 1 }
|
||||
},
|
||||
{
|
||||
"name": "af_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "af_public_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 255 }
|
||||
},
|
||||
{
|
||||
"name": "af_hidden",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_hit_count",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_throttled",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_deleted",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_actions",
|
||||
"type": "string",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "af_global",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_group",
|
||||
"type": "binary",
|
||||
"options": { "notnull": true, "length": 64, "default": "default" }
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "af_user",
|
||||
"columns": [ "af_user" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "af_actor",
|
||||
"columns": [ "af_actor" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "af_group_enabled",
|
||||
"columns": [ "af_group", "af_enabled", "af_id" ],
|
||||
"unique": false
|
||||
}
|
||||
],
|
||||
"pk": [ "af_id" ]
|
||||
},
|
||||
"after": {
|
||||
"name": "abuse_filter",
|
||||
"columns": [
|
||||
{
|
||||
"name": "af_id",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "autoincrement": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "af_pattern",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "af_actor",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "af_timestamp",
|
||||
"type": "mwtimestamp",
|
||||
"options": { "notnull": true }
|
||||
},
|
||||
{
|
||||
"name": "af_enabled",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 1 }
|
||||
},
|
||||
{
|
||||
"name": "af_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "af_public_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 255 }
|
||||
},
|
||||
{
|
||||
"name": "af_hidden",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_hit_count",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_throttled",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_deleted",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_actions",
|
||||
"type": "string",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "af_global",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_group",
|
||||
"type": "binary",
|
||||
"options": { "notnull": true, "length": 64, "default": "default" }
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "af_actor",
|
||||
"columns": [ "af_actor" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "af_group_enabled",
|
||||
"columns": [ "af_group", "af_enabled", "af_id" ],
|
||||
"unique": false
|
||||
}
|
||||
],
|
||||
"pk": [ "af_id" ]
|
||||
}
|
||||
}
|
189
db_patches/abstractSchemaChanges/patch-drop-afh_user.json
Normal file
189
db_patches/abstractSchemaChanges/patch-drop-afh_user.json
Normal file
|
@ -0,0 +1,189 @@
|
|||
{
|
||||
"comment": "Drop afh_user and afh_user_text fields from abuse_filter_history",
|
||||
"before": {
|
||||
"name": "abuse_filter_history",
|
||||
"columns": [
|
||||
{
|
||||
"name": "afh_id",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "autoincrement": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_filter",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_user",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "afh_user_text",
|
||||
"type": "binary",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "afh_actor",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "afh_timestamp",
|
||||
"type": "mwtimestamp",
|
||||
"options": { "notnull": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_pattern",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "afh_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "afh_flags",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 255 }
|
||||
},
|
||||
{
|
||||
"name": "afh_public_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 255 }
|
||||
},
|
||||
{
|
||||
"name": "afh_actions",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "afh_deleted",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "afh_changed_fields",
|
||||
"type": "string",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "afh_group",
|
||||
"type": "binary",
|
||||
"options": { "notnull": false, "length": 64 }
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "afh_filter",
|
||||
"columns": [ "afh_filter" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_user",
|
||||
"columns": [ "afh_user" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_user_text",
|
||||
"columns": [ "afh_user_text" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_actor",
|
||||
"columns": [ "afh_actor" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_timestamp",
|
||||
"columns": [ "afh_timestamp" ],
|
||||
"unique": false
|
||||
}
|
||||
],
|
||||
"pk": [ "afh_id" ]
|
||||
},
|
||||
"after": {
|
||||
"name": "abuse_filter_history",
|
||||
"columns": [
|
||||
{
|
||||
"name": "afh_id",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "autoincrement": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_filter",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_actor",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_timestamp",
|
||||
"type": "mwtimestamp",
|
||||
"options": { "notnull": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_pattern",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "afh_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "afh_flags",
|
||||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 255 }
|
||||
},
|
||||
{
|
||||
"name": "afh_public_comments",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 255 }
|
||||
},
|
||||
{
|
||||
"name": "afh_actions",
|
||||
"type": "blob",
|
||||
"options": { "notnull": false, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "afh_deleted",
|
||||
"type": "mwtinyint",
|
||||
"options": { "notnull": true, "length": 1, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "afh_changed_fields",
|
||||
"type": "string",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "afh_group",
|
||||
"type": "binary",
|
||||
"options": { "notnull": false, "length": 64 }
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "afh_filter",
|
||||
"columns": [ "afh_filter" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_actor",
|
||||
"columns": [ "afh_actor" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_timestamp",
|
||||
"columns": [ "afh_timestamp" ],
|
||||
"unique": false
|
||||
}
|
||||
],
|
||||
"pk": [ "afh_id" ]
|
||||
}
|
||||
}
|
9
db_patches/mysql/patch-drop-af_user.sql
Normal file
9
db_patches/mysql/patch-drop-af_user.sql
Normal file
|
@ -0,0 +1,9 @@
|
|||
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
||||
-- Source: db_patches/abstractSchemaChanges/patch-drop-af_user.json
|
||||
-- Do not modify this file directly.
|
||||
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
||||
DROP INDEX af_user ON /*_*/abuse_filter;
|
||||
ALTER TABLE /*_*/abuse_filter
|
||||
DROP af_user,
|
||||
DROP af_user_text,
|
||||
CHANGE af_actor af_actor BIGINT UNSIGNED NOT NULL;
|
10
db_patches/mysql/patch-drop-afh_user.sql
Normal file
10
db_patches/mysql/patch-drop-afh_user.sql
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
||||
-- Source: db_patches/abstractSchemaChanges/patch-drop-afh_user.json
|
||||
-- Do not modify this file directly.
|
||||
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
||||
DROP INDEX afh_user ON /*_*/abuse_filter_history;
|
||||
DROP INDEX afh_user_text ON /*_*/abuse_filter_history;
|
||||
ALTER TABLE /*_*/abuse_filter_history
|
||||
DROP afh_user,
|
||||
DROP afh_user_text,
|
||||
CHANGE afh_actor afh_actor BIGINT UNSIGNED NOT NULL;
|
|
@ -5,9 +5,7 @@
|
|||
CREATE TABLE /*_*/abuse_filter (
|
||||
af_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
|
||||
af_pattern BLOB NOT NULL,
|
||||
af_user BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
af_user_text VARBINARY(255) DEFAULT '' NOT NULL,
|
||||
af_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
af_actor BIGINT UNSIGNED NOT NULL,
|
||||
af_timestamp BINARY(14) NOT NULL,
|
||||
af_enabled TINYINT(1) DEFAULT 1 NOT NULL,
|
||||
af_comments BLOB DEFAULT NULL,
|
||||
|
@ -19,7 +17,6 @@ CREATE TABLE /*_*/abuse_filter (
|
|||
af_actions VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
af_global TINYINT(1) DEFAULT 0 NOT NULL,
|
||||
af_group VARBINARY(64) DEFAULT 'default' NOT NULL,
|
||||
INDEX af_user (af_user),
|
||||
INDEX af_actor (af_actor),
|
||||
INDEX af_group_enabled (af_group, af_enabled, af_id),
|
||||
PRIMARY KEY(af_id)
|
||||
|
@ -72,9 +69,7 @@ CREATE TABLE /*_*/abuse_filter_log (
|
|||
CREATE TABLE /*_*/abuse_filter_history (
|
||||
afh_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
|
||||
afh_filter BIGINT UNSIGNED NOT NULL,
|
||||
afh_user BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
afh_user_text VARBINARY(255) DEFAULT '' NOT NULL,
|
||||
afh_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
afh_actor BIGINT UNSIGNED NOT NULL,
|
||||
afh_timestamp BINARY(14) NOT NULL,
|
||||
afh_pattern BLOB NOT NULL,
|
||||
afh_comments BLOB NOT NULL,
|
||||
|
@ -85,8 +80,6 @@ CREATE TABLE /*_*/abuse_filter_history (
|
|||
afh_changed_fields VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
afh_group VARBINARY(64) DEFAULT NULL,
|
||||
INDEX afh_filter (afh_filter),
|
||||
INDEX afh_user (afh_user),
|
||||
INDEX afh_user_text (afh_user_text),
|
||||
INDEX afh_actor (afh_actor),
|
||||
INDEX afh_timestamp (afh_timestamp),
|
||||
PRIMARY KEY(afh_id)
|
||||
|
|
11
db_patches/postgres/patch-drop-af_user.sql
Normal file
11
db_patches/postgres/patch-drop-af_user.sql
Normal file
|
@ -0,0 +1,11 @@
|
|||
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
||||
-- Source: db_patches/abstractSchemaChanges/patch-drop-af_user.json
|
||||
-- Do not modify this file directly.
|
||||
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
||||
DROP INDEX af_user;
|
||||
ALTER TABLE abuse_filter
|
||||
DROP af_user;
|
||||
ALTER TABLE abuse_filter
|
||||
DROP af_user_text;
|
||||
ALTER TABLE abuse_filter ALTER af_actor
|
||||
DROP DEFAULT;
|
12
db_patches/postgres/patch-drop-afh_user.sql
Normal file
12
db_patches/postgres/patch-drop-afh_user.sql
Normal file
|
@ -0,0 +1,12 @@
|
|||
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
||||
-- Source: db_patches/abstractSchemaChanges/patch-drop-afh_user.json
|
||||
-- Do not modify this file directly.
|
||||
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
||||
DROP INDEX afh_user;
|
||||
DROP INDEX afh_user_text;
|
||||
ALTER TABLE abuse_filter_history
|
||||
DROP afh_user;
|
||||
ALTER TABLE abuse_filter_history
|
||||
DROP afh_user_text;
|
||||
ALTER TABLE abuse_filter_history ALTER afh_actor
|
||||
DROP DEFAULT;
|
|
@ -5,9 +5,7 @@
|
|||
CREATE TABLE abuse_filter (
|
||||
af_id BIGSERIAL NOT NULL,
|
||||
af_pattern TEXT NOT NULL,
|
||||
af_user BIGINT DEFAULT 0 NOT NULL,
|
||||
af_user_text TEXT DEFAULT '' NOT NULL,
|
||||
af_actor BIGINT DEFAULT 0 NOT NULL,
|
||||
af_actor BIGINT NOT NULL,
|
||||
af_timestamp TIMESTAMPTZ NOT NULL,
|
||||
af_enabled SMALLINT DEFAULT 1 NOT NULL,
|
||||
af_comments TEXT DEFAULT NULL,
|
||||
|
@ -22,8 +20,6 @@ CREATE TABLE abuse_filter (
|
|||
PRIMARY KEY(af_id)
|
||||
);
|
||||
|
||||
CREATE INDEX af_user ON abuse_filter (af_user);
|
||||
|
||||
CREATE INDEX af_actor ON abuse_filter (af_actor);
|
||||
|
||||
CREATE INDEX af_group_enabled ON abuse_filter (af_group, af_enabled, af_id);
|
||||
|
@ -83,9 +79,7 @@ CREATE INDEX afl_wiki_timestamp ON abuse_filter_log (afl_wiki, afl_timestamp);
|
|||
CREATE TABLE abuse_filter_history (
|
||||
afh_id BIGSERIAL NOT NULL,
|
||||
afh_filter BIGINT NOT NULL,
|
||||
afh_user BIGINT DEFAULT 0 NOT NULL,
|
||||
afh_user_text TEXT DEFAULT '' NOT NULL,
|
||||
afh_actor BIGINT DEFAULT 0 NOT NULL,
|
||||
afh_actor BIGINT NOT NULL,
|
||||
afh_timestamp TIMESTAMPTZ NOT NULL,
|
||||
afh_pattern TEXT NOT NULL,
|
||||
afh_comments TEXT NOT NULL,
|
||||
|
@ -100,10 +94,6 @@ CREATE TABLE abuse_filter_history (
|
|||
|
||||
CREATE INDEX afh_filter ON abuse_filter_history (afh_filter);
|
||||
|
||||
CREATE INDEX afh_user ON abuse_filter_history (afh_user);
|
||||
|
||||
CREATE INDEX afh_user_text ON abuse_filter_history (afh_user_text);
|
||||
|
||||
CREATE INDEX afh_actor ON abuse_filter_history (afh_actor);
|
||||
|
||||
CREATE INDEX afh_timestamp ON abuse_filter_history (afh_timestamp);
|
||||
|
|
15
db_patches/sqlite/patch-drop-af_user.sql
Normal file
15
db_patches/sqlite/patch-drop-af_user.sql
Normal file
|
@ -0,0 +1,15 @@
|
|||
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
||||
-- Source: db_patches/abstractSchemaChanges/patch-drop-af_user.json
|
||||
-- Do not modify this file directly.
|
||||
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
||||
CREATE TEMPORARY TABLE /*_*/__temp__abuse_filter AS
|
||||
SELECT af_id, af_pattern, af_actor, af_timestamp, af_enabled, af_comments, af_public_comments, af_hidden, af_hit_count, af_throttled, af_deleted, af_actions, af_global, af_group
|
||||
FROM /*_*/abuse_filter;
|
||||
DROP TABLE /*_*/abuse_filter;
|
||||
CREATE TABLE /*_*/abuse_filter ( af_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, af_pattern BLOB NOT NULL, af_actor BIGINT UNSIGNED NOT NULL, af_timestamp BLOB NOT NULL, af_enabled SMALLINT DEFAULT 1 NOT NULL, af_comments BLOB DEFAULT NULL, af_public_comments BLOB DEFAULT NULL, af_hidden SMALLINT DEFAULT 0 NOT NULL, af_hit_count BIGINT DEFAULT 0 NOT NULL, af_throttled SMALLINT DEFAULT 0 NOT NULL, af_deleted SMALLINT DEFAULT 0 NOT NULL, af_actions VARCHAR(255) DEFAULT '' NOT NULL, af_global SMALLINT DEFAULT 0 NOT NULL, af_group BLOB DEFAULT 'default' NOT NULL );
|
||||
INSERT INTO /*_*/abuse_filter ( af_id, af_pattern, af_actor, af_timestamp, af_enabled, af_comments, af_public_comments, af_hidden, af_hit_count, af_throttled, af_deleted, af_actions, af_global, af_group )
|
||||
SELECT af_id, af_pattern, af_actor, af_timestamp, af_enabled, af_comments, af_public_comments, af_hidden, af_hit_count, af_throttled, af_deleted, af_actions, af_global, af_group
|
||||
FROM /*_*/__temp__abuse_filter;
|
||||
DROP TABLE /*_*/__temp__abuse_filter;
|
||||
CREATE INDEX af_actor ON /*_*/abuse_filter (af_actor);
|
||||
CREATE INDEX af_group_enabled ON /*_*/abuse_filter (af_group, af_enabled, af_id);
|
16
db_patches/sqlite/patch-drop-afh_user.sql
Normal file
16
db_patches/sqlite/patch-drop-afh_user.sql
Normal file
|
@ -0,0 +1,16 @@
|
|||
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
||||
-- Source: db_patches/abstractSchemaChanges/patch-drop-afh_user.json
|
||||
-- Do not modify this file directly.
|
||||
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
||||
CREATE TEMPORARY TABLE /*_*/__temp__abuse_filter_history AS
|
||||
SELECT afh_id, afh_filter, afh_actor, afh_timestamp, afh_pattern, afh_comments, afh_flags, afh_public_comments, afh_actions, afh_deleted, afh_changed_fields, afh_group
|
||||
FROM /*_*/abuse_filter_history;
|
||||
DROP TABLE /*_*/abuse_filter_history;
|
||||
CREATE TABLE /*_*/abuse_filter_history ( afh_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, afh_filter BIGINT UNSIGNED NOT NULL, afh_actor BIGINT UNSIGNED NOT NULL, afh_timestamp BLOB NOT NULL, afh_pattern BLOB NOT NULL, afh_comments BLOB NOT NULL, afh_flags BLOB NOT NULL, afh_public_comments BLOB DEFAULT NULL, afh_actions BLOB DEFAULT NULL, afh_deleted SMALLINT DEFAULT 0 NOT NULL, afh_changed_fields VARCHAR(255) DEFAULT '' NOT NULL, afh_group BLOB DEFAULT NULL );
|
||||
INSERT INTO /*_*/abuse_filter_history ( afh_id, afh_filter, afh_actor, afh_timestamp, afh_pattern, afh_comments, afh_flags, afh_public_comments, afh_actions, afh_deleted, afh_changed_fields, afh_group )
|
||||
SELECT afh_id, afh_filter, afh_actor, afh_timestamp, afh_pattern, afh_comments, afh_flags, afh_public_comments, afh_actions, afh_deleted, afh_changed_fields, afh_group
|
||||
FROM /*_*/__temp__abuse_filter_history;
|
||||
DROP TABLE /*_*/__temp__abuse_filter_history;
|
||||
CREATE INDEX afh_filter ON /*_*/abuse_filter_history (afh_filter);
|
||||
CREATE INDEX afh_actor ON /*_*/abuse_filter_history (afh_actor);
|
||||
CREATE INDEX afh_timestamp ON /*_*/abuse_filter_history (afh_timestamp);
|
|
@ -5,9 +5,7 @@
|
|||
CREATE TABLE /*_*/abuse_filter (
|
||||
af_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
af_pattern BLOB NOT NULL,
|
||||
af_user BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
af_user_text BLOB DEFAULT '' NOT NULL,
|
||||
af_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
af_actor BIGINT UNSIGNED NOT NULL,
|
||||
af_timestamp BLOB NOT NULL,
|
||||
af_enabled SMALLINT DEFAULT 1 NOT NULL,
|
||||
af_comments BLOB DEFAULT NULL,
|
||||
|
@ -21,8 +19,6 @@ CREATE TABLE /*_*/abuse_filter (
|
|||
af_group BLOB DEFAULT 'default' NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX af_user ON /*_*/abuse_filter (af_user);
|
||||
|
||||
CREATE INDEX af_actor ON /*_*/abuse_filter (af_actor);
|
||||
|
||||
CREATE INDEX af_group_enabled ON /*_*/abuse_filter (af_group, af_enabled, af_id);
|
||||
|
@ -81,9 +77,7 @@ CREATE INDEX afl_wiki_timestamp ON /*_*/abuse_filter_log (afl_wiki, afl_timestam
|
|||
CREATE TABLE /*_*/abuse_filter_history (
|
||||
afh_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
afh_filter BIGINT UNSIGNED NOT NULL,
|
||||
afh_user BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
afh_user_text BLOB DEFAULT '' NOT NULL,
|
||||
afh_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL,
|
||||
afh_actor BIGINT UNSIGNED NOT NULL,
|
||||
afh_timestamp BLOB NOT NULL,
|
||||
afh_pattern BLOB NOT NULL,
|
||||
afh_comments BLOB NOT NULL,
|
||||
|
@ -97,10 +91,6 @@ CREATE TABLE /*_*/abuse_filter_history (
|
|||
|
||||
CREATE INDEX afh_filter ON /*_*/abuse_filter_history (afh_filter);
|
||||
|
||||
CREATE INDEX afh_user ON /*_*/abuse_filter_history (afh_user);
|
||||
|
||||
CREATE INDEX afh_user_text ON /*_*/abuse_filter_history (afh_user_text);
|
||||
|
||||
CREATE INDEX afh_actor ON /*_*/abuse_filter_history (afh_actor);
|
||||
|
||||
CREATE INDEX afh_timestamp ON /*_*/abuse_filter_history (afh_timestamp);
|
||||
|
|
|
@ -12,20 +12,10 @@
|
|||
"type": "blob",
|
||||
"options": { "notnull": true, "length": 65530 }
|
||||
},
|
||||
{
|
||||
"name": "af_user",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "af_user_text",
|
||||
"type": "binary",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "af_actor",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
"options": { "notnull": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "af_timestamp",
|
||||
|
@ -84,11 +74,6 @@
|
|||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "af_user",
|
||||
"columns": [ "af_user" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "af_actor",
|
||||
"columns": [ "af_actor" ],
|
||||
|
@ -266,20 +251,10 @@
|
|||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_user",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
},
|
||||
{
|
||||
"name": "afh_user_text",
|
||||
"type": "binary",
|
||||
"options": { "notnull": true, "length": 255, "default": "" }
|
||||
},
|
||||
{
|
||||
"name": "afh_actor",
|
||||
"type": "bigint",
|
||||
"options": { "notnull": true, "unsigned": true, "default": 0 }
|
||||
"options": { "notnull": true, "unsigned": true }
|
||||
},
|
||||
{
|
||||
"name": "afh_timestamp",
|
||||
|
@ -333,16 +308,6 @@
|
|||
"columns": [ "afh_filter" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_user",
|
||||
"columns": [ "afh_user" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_user_text",
|
||||
"columns": [ "afh_user_text" ],
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"name": "afh_actor",
|
||||
"columns": [ "afh_actor" ],
|
||||
|
|
|
@ -183,6 +183,18 @@ class SchemaChangesHandler implements LoadExtensionSchemaUpdatesHook {
|
|||
__DIR__ . '/../../../maintenance/MigrateActorsAF.php',
|
||||
] );
|
||||
|
||||
// 1.43
|
||||
$updater->addExtensionUpdate( [
|
||||
'dropField', 'abuse_filter', 'af_user',
|
||||
"$dir/$dbType/patch-drop-af_user.sql", true
|
||||
] );
|
||||
|
||||
// 1.43
|
||||
$updater->addExtensionUpdate( [
|
||||
'dropField', 'abuse_filter_history', 'afh_user',
|
||||
"$dir/$dbType/patch-drop-afh_user.sql", true
|
||||
] );
|
||||
|
||||
$updater->addExtensionUpdate( [ [ $this, 'createAbuseFilterUser' ] ] );
|
||||
// 1.35
|
||||
$updater->addPostDatabaseUpdateMaintenance( UpdateVarDumps::class );
|
||||
|
|
|
@ -349,8 +349,6 @@ class AbuseFilterConsequencesTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
$dbw = $this->getDb();
|
||||
$defaultRowSection = [
|
||||
'af_user' => 0,
|
||||
'af_user_text' => 'FilterTester',
|
||||
'af_actor' => 1,
|
||||
'af_timestamp' => $dbw->timestamp(),
|
||||
'af_group' => 'default',
|
||||
|
|
|
@ -37,8 +37,6 @@ class SearchFiltersTest extends MaintenanceBaseTestCase {
|
|||
*/
|
||||
public function addDBData() {
|
||||
$defaultRow = [
|
||||
'af_user' => 0,
|
||||
'af_user_text' => 'FilterTester',
|
||||
'af_actor' => 1,
|
||||
'af_timestamp' => $this->db->timestamp( '20190826000000' ),
|
||||
'af_enabled' => 1,
|
||||
|
|
Loading…
Reference in a new issue