X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FPostgresUpdater.php;h=643459f11633ae60be56dbb9c1d0acad1fd0228e;hb=1c4587aabfc7e6d00171062214f5887f0e8d7ede;hp=2942c0b7f71b41324b0014e74ab47d248809a3b7;hpb=b5df3f37d1cc4cfe48c280775682e23d3b13065f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 2942c0b7f7..643459f116 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -89,8 +89,8 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addTable', 'module_deps', 'patch-module_deps.sql' ), array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), array( 'addTable', 'user_former_groups','patch-user_former_groups.sql' ), - array( 'addTable', 'config', 'patch-config.sql' ), array( 'addTable', 'external_user', 'patch-external_user.sql' ), + array( 'addTable', 'sites', 'patch-sites.sql' ), # Needed before new field array( 'convertArchive2' ), @@ -155,6 +155,11 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgField', 'archive', 'ar_sha1', "TEXT NOT NULL DEFAULT ''" ), 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 ''" ), # type changes array( 'changeField', 'archive', 'ar_deleted', 'smallint', '' ), @@ -228,65 +233,68 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgIndex', 'logging', 'logging_page_id_time', '(log_page,log_timestamp)' ), array( 'addPgIndex', 'iwlinks', 'iwl_prefix_title_from', '(iwl_prefix, iwl_title, iwl_from)' ), 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( - array('pl_from', 'int4_ops', 'btree', 0), - array('pl_namespace', 'int2_ops', 'btree', 0), - array('pl_title', 'text_ops', 'btree', 0), + array( 'pl_from', 'int4_ops', 'btree', 0 ), + array( 'pl_namespace', 'int2_ops', 'btree', 0 ), + array( 'pl_title', 'text_ops', 'btree', 0 ), ), 'CREATE UNIQUE INDEX pagelink_unique ON pagelinks (pl_from,pl_namespace,pl_title)' ), array( 'checkIndex', 'cl_sortkey', array( - array('cl_to', 'text_ops', 'btree', 0), - array('cl_sortkey', 'text_ops', 'btree', 0), - array('cl_from', 'int4_ops', 'btree', 0), + array( 'cl_to', 'text_ops', 'btree', 0 ), + array( 'cl_sortkey', 'text_ops', 'btree', 0 ), + array( 'cl_from', 'int4_ops', 'btree', 0 ), ), 'CREATE INDEX cl_sortkey ON "categorylinks" USING "btree" ("cl_to", "cl_sortkey", "cl_from")' ), array( 'checkIndex', 'logging_times', array( - array('log_timestamp', 'timestamptz_ops', 'btree', 0), + array( 'log_timestamp', 'timestamptz_ops', 'btree', 0 ), ), 'CREATE INDEX "logging_times" ON "logging" USING "btree" ("log_timestamp")' ), array( 'dropIndex', 'oldimage', 'oi_name' ), array( 'checkIndex', 'oi_name_archive_name', array( - array('oi_name', 'text_ops', 'btree', 0), - array('oi_archive_name', 'text_ops', 'btree', 0), + array( 'oi_name', 'text_ops', 'btree', 0 ), + array( 'oi_archive_name', 'text_ops', 'btree', 0 ), ), 'CREATE INDEX "oi_name_archive_name" ON "oldimage" USING "btree" ("oi_name", "oi_archive_name")' ), array( 'checkIndex', 'oi_name_timestamp', array( - array('oi_name', 'text_ops', 'btree', 0), - array('oi_timestamp', 'timestamptz_ops', 'btree', 0), + array( 'oi_name', 'text_ops', 'btree', 0 ), + array( 'oi_timestamp', 'timestamptz_ops', 'btree', 0 ), ), 'CREATE INDEX "oi_name_timestamp" ON "oldimage" USING "btree" ("oi_name", "oi_timestamp")' ), array( 'checkIndex', 'page_main_title', array( - array('page_title', 'text_pattern_ops', 'btree', 0), + array( 'page_title', 'text_pattern_ops', 'btree', 0 ), ), 'CREATE INDEX "page_main_title" ON "page" USING "btree" ("page_title" "text_pattern_ops") WHERE ("page_namespace" = 0)' ), array( 'checkIndex', 'page_mediawiki_title', array( - array('page_title', 'text_pattern_ops', 'btree', 0), + array( 'page_title', 'text_pattern_ops', 'btree', 0 ), ), 'CREATE INDEX "page_mediawiki_title" ON "page" USING "btree" ("page_title" "text_pattern_ops") WHERE ("page_namespace" = 8)' ), array( 'checkIndex', 'page_project_title', array( - array('page_title', 'text_pattern_ops', 'btree', 0), + array( 'page_title', 'text_pattern_ops', 'btree', 0 ), ), 'CREATE INDEX "page_project_title" ON "page" USING "btree" ("page_title" "text_pattern_ops") WHERE ("page_namespace" = 4)' ), array( 'checkIndex', 'page_talk_title', array( - array('page_title', 'text_pattern_ops', 'btree', 0), + array( 'page_title', 'text_pattern_ops', 'btree', 0 ), ), 'CREATE INDEX "page_talk_title" ON "page" USING "btree" ("page_title" "text_pattern_ops") WHERE ("page_namespace" = 1)' ), array( 'checkIndex', 'page_user_title', array( - array('page_title', 'text_pattern_ops', 'btree', 0), + array( 'page_title', 'text_pattern_ops', 'btree', 0 ), ), 'CREATE INDEX "page_user_title" ON "page" USING "btree" ("page_title" "text_pattern_ops") WHERE ("page_namespace" = 2)' ), array( 'checkIndex', 'page_utalk_title', array( - array('page_title', 'text_pattern_ops', 'btree', 0), + array( 'page_title', 'text_pattern_ops', 'btree', 0 ), ), 'CREATE INDEX "page_utalk_title" ON "page" USING "btree" ("page_title" "text_pattern_ops") WHERE ("page_namespace" = 3)' ), array( 'checkIndex', 'ts2_page_text', array( - array('textvector', 'tsvector_ops', 'gist', 0), + array( 'textvector', 'tsvector_ops', 'gist', 0 ), ), 'CREATE INDEX "ts2_page_text" ON "pagecontent" USING "gist" ("textvector")' ), array( 'checkIndex', 'ts2_page_title', array( - array('titlevector', 'tsvector_ops', 'gist', 0), + array( 'titlevector', 'tsvector_ops', 'gist', 0 ), ), 'CREATE INDEX "ts2_page_title" ON "page" USING "gist" ("titlevector")' ), @@ -295,10 +303,10 @@ class PostgresUpdater extends DatabaseUpdater { array( 'checkRevUserFkey' ), array( 'dropIndex', 'ipblocks', 'ipb_address'), array( 'checkIndex', 'ipb_address_unique', array( - array('ipb_address', 'text_ops', 'btree', 0), - array('ipb_user', 'int4_ops', 'btree', 0), - array('ipb_auto', 'int2_ops', 'btree', 0), - array('ipb_anon_only', 'int2_ops', 'btree', 0), + array( 'ipb_address', 'text_ops', 'btree', 0 ), + array( 'ipb_user', 'int4_ops', 'btree', 0 ), + array( 'ipb_auto', 'int2_ops', 'btree', 0 ), + array( 'ipb_anon_only', 'int2_ops', 'btree', 0 ), ), 'CREATE UNIQUE INDEX ipb_address_unique ON ipblocks (ipb_address,ipb_user,ipb_auto,ipb_anon_only)' ), @@ -501,7 +509,7 @@ END; $this->output( "Creating sequence $ns\n" ); $this->db->query( "CREATE SEQUENCE $ns" ); if( $pkey !== false ) { - $this->setDefault( $table, $pkey, '"nextval"(\'"' . $ns . '"\'::"regclass")' ); + $this->setDefault( $table, $pkey, '"nextval"(\'"' . $ns . '"\'::"regclass")' ); } } }