From: moodler Date: Wed, 13 Nov 2002 12:09:18 +0000 (+0000) Subject: Small script to force tables to be created even if the database already X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=34e46e57879eaac8b687b8ee95b3198cfea39407;p=moodle.git Small script to force tables to be created even if the database already contains tables ... useful for sharing with other applications. --- diff --git a/admin/forcetables.php b/admin/forcetables.php new file mode 100644 index 0000000000..14063821e1 --- /dev/null +++ b/admin/forcetables.php @@ -0,0 +1,42 @@ +version) { // To avoid this being used on a working site. + echo "No need to use this"; + + } else { + + $strdatabasesetup = get_string("databasesetup"); + $strdatabasesuccess = get_string("databasesuccess"); + + print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup); + if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) { + $db->debug = true; + if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) { + $db->debug = false; + notify($strdatabasesuccess); + } else { + $db->debug = false; + error("Error: Main databases NOT set up successfully"); + } + } else { + error("Error: Your database ($CFG->dbtype) is not yet fully supported by Moodle. + See the lib/db directory."); + } + print_continue("index.php"); + } +