From: Brion Vibber Date: Mon, 27 Sep 2004 07:18:49 +0000 (+0000) Subject: Tweak image img_name index updater to current tables.sql (primary key) X-Git-Tag: 1.5.0alpha1~1747 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=3cdc9384299caea586d82cebe8585d67a0d5b37d;p=lhc%2Fweb%2Fwiklou.git Tweak image img_name index updater to current tables.sql (primary key) --- diff --git a/maintenance/archives/patch-image_name_primary.sql b/maintenance/archives/patch-image_name_primary.sql new file mode 100644 index 0000000000..d584d09ff5 --- /dev/null +++ b/maintenance/archives/patch-image_name_primary.sql @@ -0,0 +1,6 @@ +-- Make the image name index unique + +ALTER TABLE image DROP INDEX img_name; + +ALTER TABLE image + ADD PRIMARY KEY img_name (img_name); diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 78bfbfaf9b..da96ef1213 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -128,11 +128,11 @@ function do_linkscc_1_3_update() { function do_image_name_unique_update() { global $wgDatabase; - if ( $wgDatabase->indexUnique( 'image', 'img_name' ) ) { - echo "...img_name already unique.\n"; + if( $wgDatabase->indexExists( 'image', 'PRIMARY' ) ) { + echo "...image primary key already set.\n"; } else { - echo "Making the img_name index unique... "; - dbsource( "maintenance/archives/patch-image_name_unique.sql", $wgDatabase ); + echo "Making img_name the primary key... "; + dbsource( "maintenance/archives/patch-image_name_primary.sql", $wgDatabase ); echo "ok\n"; } }