X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FPostgresUpdater.php;h=9ad91b78a0ab4691d61d47771dc050163abdea35;hb=5f69c21636c3ea9d09c7a152c38ff15ae1642bb7;hp=9aa1a13c4cb294fc9c29d29d8ab0a3d6f8e182a7;hpb=9cd080744ff168bf8d0630931849bb63a3d9bcdc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 9aa1a13c4c..9ad91b78a0 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -101,6 +101,8 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgField', 'archive', 'ar_len', 'INTEGER' ), array( 'addPgField', 'archive', 'ar_page_id', 'INTEGER' ), array( 'addPgField', 'archive', 'ar_parent_id', 'INTEGER' ), + array( 'addPgField', 'archive', 'ar_content_model', 'TEXT' ), + array( 'addPgField', 'archive', 'ar_content_format', 'TEXT' ), array( 'addPgField', 'categorylinks', 'cl_sortkey_prefix', "TEXT NOT NULL DEFAULT ''"), array( 'addPgField', 'categorylinks', 'cl_collation', "TEXT NOT NULL DEFAULT 0"), array( 'addPgField', 'categorylinks', 'cl_type', "TEXT NOT NULL DEFAULT 'page'"), @@ -125,6 +127,7 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgField', 'oldimage', 'oi_metadata', "BYTEA NOT NULL DEFAULT ''" ), array( 'addPgField', 'oldimage', 'oi_minor_mime', "TEXT NOT NULL DEFAULT 'unknown'" ), array( 'addPgField', 'oldimage', 'oi_sha1', "TEXT NOT NULL DEFAULT ''" ), + array( 'addPgField', 'page', 'page_content_model', 'TEXT' ), array( 'addPgField', 'page_restrictions', 'pr_id', "INTEGER NOT NULL UNIQUE DEFAULT nextval('page_restrictions_pr_id_seq')" ), array( 'addPgField', 'profiling', 'pf_memory', 'NUMERIC(18,10) NOT NULL DEFAULT 0' ), array( 'addPgField', 'recentchanges', 'rc_deleted', 'SMALLINT NOT NULL DEFAULT 0' ), @@ -139,6 +142,8 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgField', 'revision', 'rev_deleted', 'SMALLINT NOT NULL DEFAULT 0' ), array( 'addPgField', 'revision', 'rev_len', 'INTEGER' ), array( 'addPgField', 'revision', 'rev_parent_id', 'INTEGER DEFAULT NULL' ), + array( 'addPgField', 'revision', 'rev_content_model', 'TEXT' ), + array( 'addPgField', 'revision', 'rev_content_format', 'TEXT' ), array( 'addPgField', 'site_stats', 'ss_active_users', "INTEGER DEFAULT '-1'" ), array( 'addPgField', 'user_newtalk', 'user_last_timestamp', 'TIMESTAMPTZ' ), array( 'addPgField', 'logging', 'log_user_text', "TEXT NOT NULL DEFAULT ''" ), @@ -613,11 +618,11 @@ END; if ( $this->db->indexExists( $table, $index ) ) { $this->output( "...index '$index' on table '$table' already exists\n" ); } else { - $this->output( "Creating index '$index' on table '$table'\n" ); if ( preg_match( '/^\(/', $type ) ) { + $this->output( "Creating index '$index' on table '$table'\n" ); $this->db->query( "CREATE INDEX $index ON $table $type" ); } else { - $this->applyPatch( $type, true ); + $this->applyPatch( $type, true, "Creating index '$index' on table '$table'" ); } } } @@ -647,7 +652,6 @@ END; protected function convertArchive2() { if ( $this->db->tableExists( "archive2" ) ) { - $this->output( "Converting 'archive2' back to normal archive table\n" ); if ( $this->db->ruleExists( 'archive', 'archive_insert' ) ) { $this->output( "Dropping rule 'archive_insert'\n" ); $this->db->query( 'DROP RULE archive_insert ON archive' ); @@ -656,7 +660,7 @@ END; $this->output( "Dropping rule 'archive_delete'\n" ); $this->db->query( 'DROP RULE archive_delete ON archive' ); } - $this->applyPatch( 'patch-remove-archive2.sql' ); + $this->applyPatch( 'patch-remove-archive2.sql', false, "Converting 'archive2' back to normal archive table" ); } else { $this->output( "...obsolete table 'archive2' does not exist\n" ); } @@ -691,8 +695,7 @@ END; protected function checkPageDeletedTrigger() { if ( !$this->db->triggerExists( 'page', 'page_deleted' ) ) { - $this->output( "Adding function and trigger 'page_deleted' to table 'page'\n" ); - $this->applyPatch( 'patch-page_deleted.sql' ); + $this->applyPatch( 'patch-page_deleted.sql', false, "Adding function and trigger 'page_deleted' to table 'page'" ); } else { $this->output( "...table 'page' has 'page_deleted' trigger\n" ); } @@ -727,35 +730,30 @@ END; if ( $this->fkeyDeltype( 'revision_rev_user_fkey' ) == 'r' ) { $this->output( "...constraint 'revision_rev_user_fkey' is ON DELETE RESTRICT\n" ); } else { - $this->output( "Changing constraint 'revision_rev_user_fkey' to ON DELETE RESTRICT\n" ); - $this->applyPatch( 'patch-revision_rev_user_fkey.sql' ); + $this->applyPatch( 'patch-revision_rev_user_fkey.sql', false, "Changing constraint 'revision_rev_user_fkey' to ON DELETE RESTRICT" ); } } protected function checkIwlPrefix() { if ( $this->db->indexExists( 'iwlinks', 'iwl_prefix' ) ) { - $this->output( "Replacing index 'iwl_prefix' with 'iwl_prefix_from_title'...\n" ); - $this->applyPatch( 'patch-rename-iwl_prefix.sql' ); + $this->applyPatch( 'patch-rename-iwl_prefix.sql', false, "Replacing index 'iwl_prefix' with 'iwl_prefix_from_title'" ); } } protected function addInterwikiType() { - $this->output( "Refreshing add_interwiki()...\n" ); - $this->applyPatch( 'patch-add_interwiki.sql' ); + $this->applyPatch( 'patch-add_interwiki.sql', false, "Refreshing add_interwiki()" ); } protected function tsearchFixes() { # Tweak the page_title tsearch2 trigger to filter out slashes # This is create or replace, so harmless to call if not needed - $this->output( "Refreshing ts2_page_title()...\n" ); - $this->applyPatch( 'patch-ts2pagetitle.sql' ); + $this->applyPatch( 'patch-ts2pagetitle.sql', false, "Refreshing ts2_page_title()" ); # If the server is 8.3 or higher, rewrite the tsearch2 triggers # in case they have the old 'default' versions # Gather version numbers in case we need them if ( $this->db->getServerVersion() >= 8.3 ) { - $this->output( "Rewriting tsearch2 triggers...\n" ); - $this->applyPatch( 'patch-tsearch2funcs.sql' ); + $this->applyPatch( 'patch-tsearch2funcs.sql', false, "Rewriting tsearch2 triggers" ); } } }