array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
array( 'add_table', 'external_user', 'patch-external_user.sql' ),
+ array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
+ array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
),
'sqlite' => array(
$wgExtPGNewFields = array(); // table, column, column attributes; for PostgreSQL
$wgExtPGAlteredFields = array(); // table, column, new type, conversion method; for PostgreSQL
$wgExtNewIndexes = array(); // table, index, dir
+$wgExtModifiedFields = array(); //table, index, dir
# Helper function: check if the given key is present in the updatelog table.
# Obviously, only use this for updates that occur after the updatelog table was
}
}
+function modify_field($table, $field, $patch, $fullpath=false){
+ global $wgDatabase;
+ if ( !$wgDatabase->tableExists( $table ) ) {
+ wfOut( "...$table table does not exist, skipping modify field patch\n" );
+ } elseif (! $wgDatabase->fieldExists( $table, $field ) ) {
+ wfOut( "...$field field does not exist in $table table, skipping modify field patch\n" );
+ } else {
+ wfOut( "Modifying $field field of table $table..." );
+ if( $fullpath ) {
+ $wgDatabase->sourceFile( $patch );
+ } else {
+ $wgDatabase->sourceFile( archive($patch) );
+ }
+ wfOut( "ok\n" );
+ }
+}
+
+
+
function add_field( $table, $field, $patch, $fullpath=false ) {
global $wgDatabase;
if ( !$wgDatabase->tableExists( $table ) ) {
}
function do_backlinking_indices_update() {
+ global $wgDatabase;
wfOut( "Checking for backlinking indices...\n" );
if (!index_has_field('pagelinks', 'pl_namespace', 'pl_from') ||
!index_has_field('templatelinks', 'tl_namespace', 'tl_from') ||
}
function do_categorylinks_indices_update() {
+ global $wgDatabase;
wfOut( "Checking for categorylinks indices...\n" );
if (!index_has_field('categorylinks', 'cl_sortkey', 'cl_from'))
{
wfOut( "ok.\n" );
return;
}
- SiteStatsInit::doAllAndUpdate( false );
+ SiteStatsInit::doAllAndCommit( false );
}
function do_active_users_init() {
}
function do_all_updates( $shared = false, $purge = true ) {
- global $wgNewTables, $wgNewFields, $wgRenamedTables, $wgSharedDB, $wgSharedTables, $wgDatabase, $wgDBtype, $IP;
+ global $wgNewTables, $wgExtModifiedFields, $wgNewFields, $wgRenamedTables, $wgSharedDB, $wgSharedTables, $wgDatabase, $wgDBtype, $IP;
wfRunHooks('LoadExtensionSchemaUpdates');
add_index( $fieldRecord[0], $fieldRecord[1], $fieldRecord[2], true );
flush();
}
+ # Add modified extension fields
+ foreach ( $wgExtModifiedFields as $fieldRecord ) {
+ modify_field($fieldRecord[0], $fieldRecord[1], $fieldRecord[2], true);
+ flush();
+ }
wfOut( "Deleting old default messages (this may take a long time!)..." );