Created
July 29, 2009 16:43
-
-
Save commana/158259 to your computer and use it in GitHub Desktop.
A quick way to create all statements to migrate MyISAM tables to InnoDB
This file contains 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
<?php | |
$sql = "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'estudy_v2' AND ENGINE = 'MyISAM'"; | |
$tables = $db->get_col($sql); | |
foreach($tables as $tableName) { | |
echo "ALTER TABLE `$tableName` ENGINE = InnoDB ;\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment