Check if the database has any existing tables before installing.
This commit is contained in:
parent
df4ab51dd9
commit
5cacf852e2
@ -300,6 +300,14 @@ function create_tables() { // {{{
|
|||||||
try {
|
try {
|
||||||
$db = new Database();
|
$db = new Database();
|
||||||
|
|
||||||
|
if ( count($db->get_all("SHOW TABLES")) > 0 ) {
|
||||||
|
echo "
|
||||||
|
<p>Warning: The Database schema is not empty!</p>
|
||||||
|
<p>Please ensure that the database you are installing Shimmie with is empty before continuing.</p>
|
||||||
|
<p>Once you have emptied the database of any tables, please hit 'refresh' to continue.</p>";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$db->create_table("aliases", "
|
$db->create_table("aliases", "
|
||||||
oldtag VARCHAR(128) NOT NULL PRIMARY KEY,
|
oldtag VARCHAR(128) NOT NULL PRIMARY KEY,
|
||||||
newtag VARCHAR(128) NOT NULL,
|
newtag VARCHAR(128) NOT NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user