From 5cacf852e2a8d0a8fa8872c41b169bbc71d0f67b Mon Sep 17 00:00:00 2001 From: "green-ponies (jgen)" Date: Mon, 9 Apr 2012 16:43:12 -0400 Subject: [PATCH] Check if the database has any existing tables before installing. --- install.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.php b/install.php index a08ac4d0..104a5776 100644 --- a/install.php +++ b/install.php @@ -300,6 +300,14 @@ function create_tables() { // {{{ try { $db = new Database(); + if ( count($db->get_all("SHOW TABLES")) > 0 ) { + echo " +

Warning: The Database schema is not empty!

+

Please ensure that the database you are installing Shimmie with is empty before continuing.

+

Once you have emptied the database of any tables, please hit 'refresh' to continue.

"; + exit; + } + $db->create_table("aliases", " oldtag VARCHAR(128) NOT NULL PRIMARY KEY, newtag VARCHAR(128) NOT NULL,