Created
July 24, 2012 22:34
-
-
Save rjmackay/3173122 to your computer and use it in GitHub Desktop.
Better table prefix handling in Upgrader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ -319,19 +319,25 @@ class Upgrade_Controller extends Admin_Controller { | |
if ($table_prefix) | |
{ | |
$find = array( | |
'CREATE TABLE IF NOT EXISTS `', | |
'INSERT INTO `', | |
+ 'INSERT IGNORE INTO `', | |
'ALTER TABLE `', | |
- 'UPDATE `' | |
+ 'UPDATE `', | |
+ 'DELETE FROM `', | |
+ 'LOCK TABLES `', | |
); | |
$replace = array( | |
- 'CREATE TABLE IF NOT EXISTS `'.$table_prefix.'_', | |
- 'INSERT INTO `'.$table_prefix.'_', | |
- 'ALTER TABLE `'.$table_prefix.'_', | |
- 'UPDATE `'.$table_prefix.'_' | |
+ 'CREATE TABLE IF NOT EXISTS `'.$table_prefix, | |
+ 'INSERT INTO `'.$table_prefix, | |
+ 'INSERT IGNORE INTO `'.$table_prefix, | |
+ 'ALTER TABLE `'.$table_prefix, | |
+ 'UPDATE `'.$table_prefix, | |
+ 'DELETE FROM `'.$table_prefix, | |
+ 'LOCK TABLES `'.$table_prefix, | |
); | |
$upgrade_schema = str_replace($find, $replace, $upgrade_schema); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment