From: Tim Landscheidt Date: Wed, 26 Dec 2012 03:56:17 +0000 (+0000) Subject: Add column job_attempts and index job_cmd_token_id to PostgreSQL. X-Git-Tag: 1.31.0-rc.0~20826 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=5421548819600cbf9c581cb3f412c6da0edcdd1c;p=lhc%2Fweb%2Fwiklou.git Add column job_attempts and index job_cmd_token_id to PostgreSQL. * (bug 43416) This ports cd000590ee694af73edb05b5e37b60b5e2b77fd5. Change-Id: I3d4c7d906f6465b3a054df2fc0cd8f564173ed2b --- diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 5a13d4211d..a332332217 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -155,6 +155,7 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgField', 'uploadstash', 'us_chunk_inx', "INTEGER NULL" ), array( 'addPgField', 'job', 'job_timestamp', "TIMESTAMPTZ" ), array( 'addPgField', 'job', 'job_random', "INTEGER NOT NULL DEFAULT 0" ), + array( 'addPgField', 'job', 'job_attempts', "INTEGER NOT NULL DEFAULT 0" ), array( 'addPgField', 'job', 'job_token', "TEXT NOT NULL DEFAULT ''" ), array( 'addPgField', 'job', 'job_token_timestamp', "TIMESTAMPTZ" ), array( 'addPgField', 'job', 'job_sha1', "TEXT NOT NULL DEFAULT ''" ), @@ -233,6 +234,7 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgIndex', 'job', 'job_timestamp_idx', '(job_timestamp)' ), array( 'addPgIndex', 'job', 'job_sha1', '(job_sha1)' ), array( 'addPgIndex', 'job', 'job_cmd_token', '(job_cmd, job_token, job_random)' ), + array( 'addPgIndex', 'job', 'job_cmd_token_id', '(job_cmd, job_token, job_id)' ), array( 'addPgIndex', 'filearchive', 'fa_sha1', '(fa_sha1)' ), array( 'checkIndex', 'pagelink_unique', array( diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index 845193da30..4fb2490b7f 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -530,12 +530,14 @@ CREATE TABLE job ( job_timestamp TIMESTAMPTZ, job_params TEXT NOT NULL, job_random INTEGER NOT NULL DEFAULT 0, + job_attempts INTEGER NOT NULL DEFAULT 0, job_token TEXT NOT NULL DEFAULT '', job_token_timestamp TIMESTAMPTZ, job_sha1 TEXT NOT NULL DEFAULT '' ); CREATE INDEX job_sha1 ON job (job_sha1); CREATE INDEX job_cmd_token ON job (job_cmd, job_token, job_random); +CREATE INDEX job_cmd_token_id ON job (job_cmd, job_token, job_id); CREATE INDEX job_cmd_namespace_title ON job (job_cmd, job_namespace, job_title); CREATE INDEX job_timestamp_idx ON job (job_timestamp);