--- /dev/null
+-- Fix a bug from the 1.2 -> 1.3 upgrader by moving away the imagelinks table
+-- and recreating it.
+RENAME TABLE /*_*/imagelinks TO /*_*/imagelinks_old;
+CREATE TABLE /*_*/imagelinks (
+ il_from int unsigned NOT NULL default 0,
+ il_to varchar(255) binary NOT NULL default ''
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to);
+CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from);
+
array( 'add_table', 'categorylinks', 'patch-categorylinks.sql' ),
// do_linkscc_1_3_update obsolete
array( 'do_old_links_update' ),
+ array( 'fix_ancient_imagelinks' ),
array( 'add_field', 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ),
// 1.4
}
}
+function fix_ancient_imagelinks() {
+ global $wgDatabase;
+ $info = $wgDatabase->fieldInfo( 'imagelinks', 'il_from' );
+ if ( $info && $info->type() === 'string' ) {
+ wfOut( "Fixing ancient broken imagelinks table.\n" );
+ wfOut( "NOTE: you will have to run maintenance/refreshLinks.php after this.\n" );
+ dbsource( archive( 'patch-fix-il_from.sql' ) );
+ wfOut( "ok\n" );
+ } else {
+ wfOut( "...il_from OK\n" );
+ }
+}
+
function do_user_unique_update() {
global $wgDatabase;
$duper = new UserDupes( $wgDatabase );