]> git.mjollnir.org Git - moodle.git/commitdiff
Working but unpolished script to convert all MySQL tables to InnoDB format
authormoodler <moodler>
Tue, 21 Sep 2004 08:40:18 +0000 (08:40 +0000)
committermoodler <moodler>
Tue, 21 Sep 2004 08:40:18 +0000 (08:40 +0000)
Not linked, just call it directly

admin/innodb.php [new file with mode: 0644]

diff --git a/admin/innodb.php b/admin/innodb.php
new file mode 100644 (file)
index 0000000..bd1eb67
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+   include('config.php');
+
+   require_login();
+
+   if (!isadmin) {
+       error('Admin only');
+   }
+
+   print_header("Convert all tables from MYISAM to InnoDB", "Convert all tables from MYISAM to InnoDB", 
+                "Convert all tables from MYISAM to InnoDB");
+
+
+   if ($confirm) {
+
+       print_heading("Please be patient and wait for this to complete...");
+
+       if ($tables = $db->MetaTables()) {
+           $db->debug = true;
+           foreach ($tables as $table) {
+               execute_sql("ALTER TABLE $table TYPE=INNODB; ");
+           }
+       }
+   } else {
+       notice("Are you sure you want convert all your tables to the InnoDB format?", "innodb.php?confirm=yes", "index.php");
+   }
+
+?>