[ 'addPgField', 'protected_titles', 'pt_reason_id', 'INTEGER NOT NULL DEFAULT 0' ],
[ 'addTable', 'comment', 'patch-comment-table.sql' ],
[ 'addIndex', 'site_stats', 'site_stats_pkey', 'patch-site_stats-pk.sql' ],
+ [ 'addTable', 'ip_changes', 'patch-ip_changes.sql' ],
];
}
}
public function doDBUpdates() {
+ $dbw = $this->getDB( DB_MASTER );
+
+ if ( !$dbw->tableExists( 'ip_changes' ) ) {
+ $this->fatalError( 'ip_changes table does not exist' );
+ }
+
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
- $dbw = $this->getDB( DB_MASTER );
$throttle = intval( $this->getOption( 'throttle', 0 ) );
$maxRevId = intval( $this->getOption( 'max-rev-id', 0 ) );
$start = $this->getOption( 'rev-id', 0 );
--- /dev/null
+CREATE SEQUENCE ip_changes_ipc_rev_id_seq;
+
+CREATE TABLE ip_changes (
+ ipc_rev_id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('ip_changes_ipc_rev_id_seq'),
+ ipc_rev_timestamp TIMESTAMPTZ NOT NULL DEFAULT '',
+ ipc_hex BYTEA NOT NULL DEFAULT ''
+);
+
+CREATE INDEX ipc_rev_timestamp ON ip_changes (ipc_rev_timestamp);
+CREATE INDEX ipc_hex_time ON ip_changes (ipc_hex,ipc_rev_timestamp);