From 34e46e57879eaac8b687b8ee95b3198cfea39407 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 13 Nov 2002 12:09:18 +0000 Subject: [PATCH] Small script to force tables to be created even if the database already contains tables ... useful for sharing with other applications. --- admin/forcetables.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 admin/forcetables.php 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"); + } + -- 2.39.5