09-10-2010, 02:34 PM
The current fresh install script is extremely hostile! It's unforgivable to drop an existing database, even if you put a Javascript warning up to let people know what's coming!
What I don't understand is why, if the database you specify already exists (which implies there's data in it already) you would drop it instead of just adding your new tables into it? Especially when you can conditionally create the database if it doesn't exist.
Here's the patch, somebody put it in into install/index.php straight away. Geez, this has the potential to be an absolutely awful first-run experience for new users. I'm disgusted.
What I don't understand is why, if the database you specify already exists (which implies there's data in it already) you would drop it instead of just adding your new tables into it? Especially when you can conditionally create the database if it doesn't exist.
Here's the patch, somebody put it in into install/index.php straight away. Geez, this has the potential to be an absolutely awful first-run experience for new users. I'm disgusted.
Code:
install/index.php
170,173c170
< $result = mysql_query("DROP DATABASE IF EXISTS {$GLOBALS['database']}")
< or die("<br>Unable to Create Database - Error in query:" . mysql_error());
<
< $result = mysql_query("CREATE DATABASE {$GLOBALS['database']}")
---
> $result = mysql_query("CREATE DATABASE IF NOT EXISTS {$GLOBALS['database']}")