* @file
* @ingroup Deployment
*/
-
+
/**
* Class for handling updates to Postgres databases.
*
class PostgresUpdater extends DatabaseUpdater {
+ /**
+ * @var DatabasePostgres
+ */
+ protected $db;
+
/**
* @todo FIXME: Postgres should use sequential updates like Mysql, Sqlite
* and everybody else. It never got refactored like it should've.
+ * @return array
*/
protected function getCoreUpdateList() {
return array(
- # beginning
- array( 'checkPgUser' ),
+ # rename tables 1.7.3
+ # r15791 Change reserved word table names "user" and "text"
+ array( 'renameTable', 'user', 'mwuser'),
+ array( 'renameTable', 'text', 'pagecontent'),
# new sequences
array( 'addSequence', 'logging_log_id_seq' ),
array( 'renameSequence', 'rc_rc_id_seq', 'recentchanges_rc_id_seq' ),
array( 'renameSequence', 'log_log_id_seq', 'logging_log_id_seq' ),
array( 'renameSequence', 'pr_id_val', 'page_restrictions_pr_id_seq' ),
+ array( 'renameSequence', 'us_id_seq', 'uploadstash_us_id_seq' ),
# new tables
array( 'addTable', 'category', 'patch-category.sql' ),
- array( 'addTable', 'mwuser', 'patch-mwuser.sql' ),
array( 'addTable', 'page', 'patch-page.sql' ),
- array( 'addTable', 'pagecontent', 'patch-pagecontent.sql' ),
array( 'addTable', 'querycachetwo', 'patch-querycachetwo.sql' ),
array( 'addTable', 'page_props', 'patch-page_props.sql' ),
array( 'addTable', 'page_restrictions', 'patch-page_restrictions.sql' ),
array( 'addTable', 'redirect', 'patch-redirect.sql' ),
array( 'addTable', 'updatelog', 'patch-updatelog.sql' ),
array( 'addTable', 'change_tag', 'patch-change_tag.sql' ),
- array( 'addTable', 'tag_summary', 'patch-change_tag.sql' ),
- array( 'addTable', 'valid_tag', 'patch-change_tag.sql' ),
+ array( 'addTable', 'tag_summary', 'patch-tag_summary.sql' ),
+ array( 'addTable', 'valid_tag', 'patch-valid_tag.sql' ),
array( 'addTable', 'user_properties', 'patch-user_properties.sql' ),
array( 'addTable', 'log_search', 'patch-log_search.sql' ),
array( 'addTable', 'l10n_cache', 'patch-l10n_cache.sql' ),
array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ),
array( 'addTable', 'msg_resource_links','patch-msg_resource_links.sql' ),
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' ),
# Needed before new field
array( 'convertArchive2' ),
array( 'addPgField', 'logging', 'log_id', "INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('logging_log_id_seq')" ),
array( 'addPgField', 'logging', 'log_params', 'TEXT' ),
array( 'addPgField', 'mwuser', 'user_editcount', 'INTEGER' ),
- array( 'addPgField', 'mwuser', 'user_hidden', 'SMALLINT NOT NULL DEFAULT 0' ),
array( 'addPgField', 'mwuser', 'user_newpass_time', 'TIMESTAMPTZ' ),
array( 'addPgField', 'oldimage', 'oi_deleted', 'SMALLINT NOT NULL DEFAULT 0' ),
array( 'addPgField', 'oldimage', 'oi_major_mime', "TEXT NOT NULL DEFAULT 'unknown'" ),
array( 'addPgField', 'logging', 'log_page', 'INTEGER' ),
array( 'addPgField', 'interwiki', 'iw_api', "TEXT NOT NULL DEFAULT ''"),
array( 'addPgField', 'interwiki', 'iw_wikiid', "TEXT NOT NULL DEFAULT ''"),
+ array( 'addPgField', 'revision', 'rev_sha1', "TEXT NOT NULL DEFAULT ''" ),
+ array( 'addPgField', 'archive', 'ar_sha1', "TEXT NOT NULL DEFAULT ''" ),
+ array( 'addPgField', 'uploadstash', 'us_chunk_inx', "INTEGER NULL" ),
+ array( 'addPgField', 'job', 'job_timestamp', "TIMESTAMPTZ" ),
# type changes
array( 'changeField', 'archive', 'ar_deleted', 'smallint', '' ),
array( 'changeField', 'ipblocks', 'ipb_block_email', 'smallint', "CASE WHEN ipb_block_email=' ' THEN 0 ELSE ipb_block_email::smallint END DEFAULT 0" ),
array( 'changeField', 'ipblocks', 'ipb_address', 'text', 'ipb_address::text' ),
array( 'changeField', 'ipblocks', 'ipb_deleted', 'smallint', 'ipb_deleted::smallint DEFAULT 0' ),
- array( 'changeField', 'math', 'math_inputhash', 'bytea', "decode(math_inputhash,'escape')" ),
- array( 'changeField', 'math', 'math_outputhash', 'bytea', "decode(math_outputhash,'escape')" ),
array( 'changeField', 'mwuser', 'user_token', 'text', '' ),
array( 'changeField', 'mwuser', 'user_email_token', 'text', '' ),
array( 'changeField', 'objectcache', 'keyname', 'text', '' ),
array( 'changeField', 'revision', 'rev_minor_edit', 'smallint', 'rev_minor_edit::smallint DEFAULT 0' ),
array( 'changeField', 'templatelinks', 'tl_namespace', 'smallint', 'tl_namespace::smallint' ),
array( 'changeField', 'user_newtalk', 'user_ip', 'text', 'host(user_ip)' ),
+ array( 'changeField', 'uploadstash', 'us_image_bits', 'smallint', '' ),
# null changes
array( 'changeNullableField', 'oldimage', 'oi_bits', 'NULL' ),
array( 'addPgIndex', 'logging', 'logging_user_type_time', '(log_user, log_type, log_timestamp)' ),
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( 'checkOiNameConstraint' ),
array( 'checkPageDeletedTrigger' ),
array( 'changeFkeyDeferrable', 'revision', 'rev_page', 'page (page_id) ON DELETE CASCADE' ),
array( 'changeFkeyDeferrable', 'revision', 'rev_user', 'mwuser(user_id) ON DELETE RESTRICT' ),
array( 'changeFkeyDeferrable', 'templatelinks', 'tl_from', 'page(page_id) ON DELETE CASCADE' ),
- array( 'changeFkeyDeferrable', 'trackbacks', 'tb_page', 'page(page_id) ON DELETE CASCADE' ),
array( 'changeFkeyDeferrable', 'user_groups', 'ug_user', 'mwuser(user_id) ON DELETE CASCADE' ),
array( 'changeFkeyDeferrable', 'user_newtalk', 'user_id', 'mwuser(user_id) ON DELETE CASCADE' ),
array( 'changeFkeyDeferrable', 'user_properties', 'up_user', 'mwuser(user_id) ON DELETE CASCADE' ),
$fieldRecord[2]
);
}
-
+
return $updates;
}
protected function describeTable( $table ) {
- global $wgDBmwschema;
$q = <<<END
SELECT attname, attnum FROM pg_namespace, pg_class, pg_attribute
WHERE pg_class.relnamespace = pg_namespace.oid
END;
$res = $this->db->query( sprintf( $q,
$this->db->addQuotes( $table ),
- $this->db->addQuotes( $wgDBmwschema ) ) );
+ $this->db->addQuotes( $this->db->getCoreSchema() ) ) );
if ( !$res ) {
return null;
}
}
function describeIndex( $idx ) {
- global $wgDBmwschema;
-
// first fetch the key (which is a list of columns ords) and
// the table the index applies to (an oid)
$q = <<<END
$res = $this->db->query(
sprintf(
$q,
- $this->db->addQuotes( $wgDBmwschema ),
+ $this->db->addQuotes( $this->db->getCoreSchema() ),
$this->db->addQuotes( $idx )
)
);
}
function fkeyDeltype( $fkey ) {
- global $wgDBmwschema;
$q = <<<END
SELECT confdeltype FROM pg_constraint, pg_namespace
WHERE connamespace=pg_namespace.oid
$r = $this->db->query(
sprintf(
$q,
- $this->db->addQuotes( $wgDBmwschema ),
+ $this->db->addQuotes( $this->db->getCoreSchema() ),
$this->db->addQuotes( $fkey )
)
);
}
function ruleDef( $table, $rule ) {
- global $wgDBmwschema;
$q = <<<END
SELECT definition FROM pg_rules
WHERE schemaname = %s
$r = $this->db->query(
sprintf(
$q,
- $this->db->addQuotes( $wgDBmwschema ),
+ $this->db->addQuotes( $this->db->getCoreSchema() ),
$this->db->addQuotes( $table ),
$this->db->addQuotes( $rule )
)
}
protected function renameSequence( $old, $new ) {
+ if ( $this->db->sequenceExists( $new ) ) {
+ $this->output( "...sequence $new already exists.\n" );
+ return;
+ }
if ( $this->db->sequenceExists( $old ) ) {
$this->output( "Renaming sequence $old to $new\n" );
$this->db->query( "ALTER SEQUENCE $old RENAME TO $new" );
}
}
+ protected function renameTable( $old, $new ) {
+ if ( $this->db->tableExists( $old ) ) {
+ $this->output( "Renaming table $old to $new\n" );
+ $old = $this->db->realTableName( $old, "quoted" );
+ $new = $this->db->realTableName( $new, "quoted" );
+ $this->db->query( "ALTER TABLE $old RENAME TO $new" );
+ }
+ }
+
protected function addPgField( $table, $field, $type ) {
$fi = $this->db->fieldInfo( $table, $field );
if ( !is_null( $fi ) ) {
- $this->output( "... column \"$table.$field\" already exists\n" );
+ $this->output( "...column '$table.$field' already exists\n" );
return;
} else {
- $this->output( "Adding column \"$table.$field\"\n" );
+ $this->output( "Adding column '$table.$field'\n" );
$this->db->query( "ALTER TABLE $table ADD $field $type" );
}
}
protected function changeField( $table, $field, $newtype, $default ) {
$fi = $this->db->fieldInfo( $table, $field );
if ( is_null( $fi ) ) {
- $this->output( "... error: expected column $table.$field to exist\n" );
+ $this->output( "...ERROR: expected column $table.$field to exist\n" );
exit( 1 );
}
if ( $fi->type() === $newtype )
- $this->output( "... column \"$table.$field\" is already of type \"$newtype\"\n" );
+ $this->output( "...column '$table.$field' is already of type '$newtype'\n" );
else {
- $this->output( "Changing column type of \"$table.$field\" from \"{$fi->type()}\" to \"$newtype\"\n" );
+ $this->output( "Changing column type of '$table.$field' from '{$fi->type()}' to '$newtype'\n" );
$sql = "ALTER TABLE $table ALTER $field TYPE $newtype";
if ( strlen( $default ) ) {
$res = array();
}
$sql .= " USING $default";
}
- $sql .= ";\nCOMMIT;\n";
+ $this->db->begin( __METHOD__ );
$this->db->query( $sql );
+ $this->db->commit( __METHOD__ );
}
}
protected function changeNullableField( $table, $field, $null ) {
$fi = $this->db->fieldInfo( $table, $field );
if ( is_null( $fi ) ) {
- $this->output( "... error: expected column $table.$field to exist\n" );
+ $this->output( "...ERROR: expected column $table.$field to exist\n" );
exit( 1 );
}
if ( $fi->isNullable() ) {
# # It's NULL - does it need to be NOT NULL?
if ( 'NOT NULL' === $null ) {
- $this->output( "Changing \"$table.$field\" to not allow NULLs\n" );
+ $this->output( "Changing '$table.$field' to not allow NULLs\n" );
$this->db->query( "ALTER TABLE $table ALTER $field SET NOT NULL" );
} else {
- $this->output( "... column \"$table.$field\" is already set as NULL\n" );
+ $this->output( "...column '$table.$field' is already set as NULL\n" );
}
} else {
# # It's NOT NULL - does it need to be NULL?
if ( 'NULL' === $null ) {
- $this->output( "Changing \"$table.$field\" to allow NULLs\n" );
+ $this->output( "Changing '$table.$field' to allow NULLs\n" );
$this->db->query( "ALTER TABLE $table ALTER $field DROP NOT NULL" );
}
else {
- $this->output( "... column \"$table.$field\" is already set as NOT NULL\n" );
+ $this->output( "...column '$table.$field' is already set as NOT NULL\n" );
}
}
}
public function addPgIndex( $table, $index, $type ) {
if ( $this->db->indexExists( $table, $index ) ) {
- $this->output( "... index \"$index\" on table \"$table\" already exists\n" );
+ $this->output( "...index '$index' on table '$table' already exists\n" );
} else {
- $this->output( "Creating index \"$index\" on table \"$table\" $type\n" );
+ $this->output( "Creating index '$index' on table '$table' $type\n" );
$this->db->query( "CREATE INDEX $index ON $table $type" );
}
}
public function addPgExtIndex( $table, $index, $type ) {
if ( $this->db->indexExists( $table, $index ) ) {
- $this->output( "... index \"$index\" on table \"$table\" already exists\n" );
+ $this->output( "...index '$index' on table '$table' already exists\n" );
} else {
- $this->output( "Creating index \"$index\" on table \"$table\"\n" );
+ $this->output( "Creating index '$index' on table '$table'\n" );
if ( preg_match( '/^\(/', $type ) ) {
$this->db->query( "CREATE INDEX $index ON $table $type" );
} else {
protected function changeFkeyDeferrable( $table, $field, $clause ) {
$fi = $this->db->fieldInfo( $table, $field );
if ( is_null( $fi ) ) {
- $this->output( "WARNING! Column \"$table.$field\" does not exist but it should! Please report this.\n" );
+ $this->output( "WARNING! Column '$table.$field' does not exist but it should! Please report this.\n" );
return;
}
if ( $fi->is_deferred() && $fi->is_deferrable() ) {
return;
}
- $this->output( "Altering column \"$table.$field\" to be DEFERRABLE INITIALLY DEFERRED\n" );
+ $this->output( "Altering column '$table.$field' to be DEFERRABLE INITIALLY DEFERRED\n" );
$conname = $fi->conname();
- $command = "ALTER TABLE $table DROP CONSTRAINT $conname";
- $this->db->query( $command );
- $command = "ALTER TABLE $table ADD CONSTRAINT $conname FOREIGN KEY ($field) REFERENCES $clause DEFERRABLE INITIALLY DEFERRED";
- $this->db->query( $command );
- }
-
- /**
- * Verify that this user is configured correctly
- */
- protected function checkPgUser() {
- global $wgDBmwschema, $wgDBts2schema, $wgDBuser;
-
- # Just in case their LocalSettings.php does not have this:
- if ( !isset( $wgDBmwschema ) ) {
- $wgDBmwschema = 'mediawiki';
- }
-
- $safeuser = $this->db->addQuotes( $wgDBuser );
- $SQL = "SELECT array_to_string(useconfig,'*') FROM pg_catalog.pg_user WHERE usename = $safeuser";
- $config = pg_fetch_result( $this->db->doQuery( $SQL ), 0, 0 );
- $conf = array();
- foreach ( explode( '*', $config ) as $c ) {
- list( $x, $y ) = explode( '=', $c );
- $conf[$x] = $y;
- }
-
- if ( !array_key_exists( 'search_path', $conf ) ) {
- $search_path = '';
+ if ( $fi->conname() ) {
+ $conclause = "CONSTRAINT \"$conname\"";
+ $command = "ALTER TABLE $table DROP CONSTRAINT $conname";
+ $this->db->query( $command );
} else {
- $search_path = $conf['search_path'];
- }
-
- if ( strpos( $search_path, $wgDBmwschema ) === false ) {
- $this->output( "Adding in schema \"$wgDBmwschema\" to search_path for user \"$wgDBuser\"\n" );
- $search_path = "$wgDBmwschema, $search_path";
- }
- if ( strpos( $search_path, $wgDBts2schema ) === false ) {
- $this->output( "Adding in schema \"$wgDBts2schema\" to search_path for user \"$wgDBuser\"\n" );
- $search_path = "$search_path, $wgDBts2schema";
- }
- $search_path = str_replace( ', ,', ',', $search_path );
- if ( array_key_exists( 'search_path', $conf ) === false || $search_path != $conf['search_path'] ) {
- $this->db->doQuery( "ALTER USER $wgDBuser SET search_path = $search_path" );
- $this->db->doQuery( "SET search_path = $search_path" );
- } else {
- $path = $conf['search_path'];
- $this->output( "... search_path for user \"$wgDBuser\" looks correct ($path)\n" );
- }
-
- $goodconf = array(
- 'client_min_messages' => 'error',
- 'DateStyle' => 'ISO, YMD',
- 'TimeZone' => 'GMT'
- );
-
- foreach ( $goodconf as $key => $value ) {
- if ( !array_key_exists( $key, $conf ) or $conf[$key] !== $value ) {
- $this->output( "Setting $key to '$value' for user \"$wgDBuser\"\n" );
- $this->db->doQuery( "ALTER USER $wgDBuser SET $key = '$value'" );
- $this->db->doQuery( "SET $key = '$value'" );
- } else {
- $this->output( "... default value of \"$key\" is correctly set to \"$value\" for user \"$wgDBuser\"\n" );
- }
+ $this->output( "Column '$table.$field' does not have a foreign key constraint, will be added\n" );
+ $conclause = "";
}
+ $command = "ALTER TABLE $table ADD $conclause FOREIGN KEY ($field) REFERENCES $clause DEFERRABLE INITIALLY DEFERRED";
+ $this->db->query( $command );
}
protected function convertArchive2() {
if ( $this->db->tableExists( "archive2" ) ) {
- $this->output( "Converting \"archive2\" back to normal archive table\n" );
+ $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->output( "Dropping rule 'archive_insert'\n" );
$this->db->query( 'DROP RULE archive_insert ON archive' );
}
if ( $this->db->ruleExists( 'archive', 'archive_delete' ) ) {
- $this->output( "Dropping rule \"archive_delete\"\n" );
+ $this->output( "Dropping rule 'archive_delete'\n" );
$this->db->query( 'DROP RULE archive_delete ON archive' );
}
$this->applyPatch( 'patch-remove-archive2.sql' );
} else {
- $this->output( "... obsolete table \"archive2\" does not exist\n" );
+ $this->output( "...obsolete table 'archive2' does not exist\n" );
}
}
protected function checkOiDeleted() {
if ( $this->db->fieldInfo( 'oldimage', 'oi_deleted' )->type() !== 'smallint' ) {
- $this->output( "Changing \"oldimage.oi_deleted\" to type \"smallint\"\n" );
+ $this->output( "Changing 'oldimage.oi_deleted' to type 'smallint'\n" );
$this->db->query( "ALTER TABLE oldimage ALTER oi_deleted DROP DEFAULT" );
$this->db->query( "ALTER TABLE oldimage ALTER oi_deleted TYPE SMALLINT USING (oi_deleted::smallint)" );
$this->db->query( "ALTER TABLE oldimage ALTER oi_deleted SET DEFAULT 0" );
} else {
- $this->output( "... column \"oldimage.oi_deleted\" is already of type \"smallint\"\n" );
+ $this->output( "...column 'oldimage.oi_deleted' is already of type 'smallint'\n" );
}
}
protected function checkOiNameConstraint() {
if ( $this->db->hasConstraint( "oldimage_oi_name_fkey_cascaded" ) ) {
- $this->output( "... table \"oldimage\" has correct cascading delete/update foreign key to image\n" );
+ $this->output( "...table 'oldimage' has correct cascading delete/update foreign key to image\n" );
} else {
if ( $this->db->hasConstraint( "oldimage_oi_name_fkey" ) ) {
$this->db->query( "ALTER TABLE oldimage DROP CONSTRAINT oldimage_oi_name_fkey" );
if ( $this->db->hasConstraint( "oldimage_oi_name_fkey_cascade" ) ) {
$this->db->query( "ALTER TABLE oldimage DROP CONSTRAINT oldimage_oi_name_fkey_cascade" );
}
- $this->output( "Making foreign key on table \"oldimage\" (to image) a cascade delete/update\n" );
+ $this->output( "Making foreign key on table 'oldimage' (to image) a cascade delete/update\n" );
$this->db->query( "ALTER TABLE oldimage ADD CONSTRAINT oldimage_oi_name_fkey_cascaded " .
"FOREIGN KEY (oi_name) REFERENCES image(img_name) ON DELETE CASCADE ON UPDATE CASCADE" );
}
protected function checkPageDeletedTrigger() {
if ( !$this->db->triggerExists( 'page', 'page_deleted' ) ) {
- $this->output( "Adding function and trigger \"page_deleted\" to table \"page\"\n" );
+ $this->output( "Adding function and trigger 'page_deleted' to table 'page'\n" );
$this->applyPatch( 'patch-page_deleted.sql' );
} else {
- $this->output( "... table \"page\" has \"page_deleted\" trigger\n" );
+ $this->output( "...table 'page' has 'page_deleted' trigger\n" );
}
}
protected function checkRcCurIdNullable(){
$fi = $this->db->fieldInfo( 'recentchanges', 'rc_cur_id' );
if ( !$fi->isNullable() ) {
- $this->output( "Removing NOT NULL constraint from \"recentchanges.rc_cur_id\"\n" );
+ $this->output( "Removing NOT NULL constraint from 'recentchanges.rc_cur_id'\n" );
$this->applyPatch( 'patch-rc_cur_id-not-null.sql' );
} else {
- $this->output( "... column \"recentchanges.rc_cur_id\" has a NOT NULL constraint\n" );
+ $this->output( "...column 'recentchanges.rc_cur_id' has a NOT NULL constraint\n" );
}
}
protected function checkPagelinkUniqueIndex() {
$pu = $this->describeIndex( 'pagelink_unique' );
if ( !is_null( $pu ) && ( $pu[0] != 'pl_from' || $pu[1] != 'pl_namespace' || $pu[2] != 'pl_title' ) ) {
- $this->output( "Dropping obsolete version of index \"pagelink_unique index\"\n" );
+ $this->output( "Dropping obsolete version of index 'pagelink_unique index'\n" );
$this->db->query( 'DROP INDEX pagelink_unique' );
$pu = null;
} else {
- $this->output( "... obsolete version of index \"pagelink_unique index\" does not exist\n" );
+ $this->output( "...obsolete version of index 'pagelink_unique index' does not exist\n" );
}
if ( is_null( $pu ) ) {
- $this->output( "Creating index \"pagelink_unique index\"\n" );
+ $this->output( "Creating index 'pagelink_unique index'\n" );
$this->db->query( 'CREATE UNIQUE INDEX pagelink_unique ON pagelinks (pl_from,pl_namespace,pl_title)' );
} else {
- $this->output( "... index \"pagelink_unique_index\" already exists\n" );
+ $this->output( "...index 'pagelink_unique_index' already exists\n" );
}
}
protected function checkRevUserFkey() {
if ( $this->fkeyDeltype( 'revision_rev_user_fkey' ) == 'r' ) {
- $this->output( "... constraint \"revision_rev_user_fkey\" is ON DELETE RESTRICT\n" );
+ $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->output( "Changing constraint 'revision_rev_user_fkey' to ON DELETE RESTRICT\n" );
$this->applyPatch( 'patch-revision_rev_user_fkey.sql' );
}
}
$this->db->query( 'DROP INDEX ipb_address' );
}
if ( $this->db->indexExists( 'ipblocks', 'ipb_address_unique' ) ) {
- $this->output( "... have ipb_address_unique\n" );
+ $this->output( "...have ipb_address_unique\n" );
} else {
$this->output( "Adding ipb_address_unique index\n" );
$this->applyPatch( 'patch-ipb_address_unique.sql' );
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' );
- # # If the server is 8.3 or higher, rewrite the tsearch2 triggers
- # # in case they have the old 'default' versions
+ # 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' );
}
}