Skip to content

Instantly share code, notes, and snippets.

@commana
Created July 29, 2009 16:43
Show Gist options
  • Save commana/158259 to your computer and use it in GitHub Desktop.
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
<?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