Prevent overwriting the database if it already exists
This commit is contained in:
parent
6047670dbd
commit
ac3ad3d23b
|
@ -36,10 +36,13 @@ class ProvisioningHelper
|
|||
$this->parsePostParams();
|
||||
|
||||
//For security, the Airtime Pro provisioning system creates the database for the user.
|
||||
// $this->setNewDatabaseConnection();
|
||||
//if ($this->checkDatabaseExists()) {
|
||||
// throw new Exception("ERROR: Airtime database already exists");
|
||||
//}
|
||||
$this->setNewDatabaseConnection();
|
||||
|
||||
//We really want to do this check because all the Propel-generated SQL starts with "DROP TABLE IF EXISTS".
|
||||
//If we don't check, then a second call to this API endpoint would wipe all the tables!
|
||||
if ($this->checkDatabaseExists()) {
|
||||
throw new Exception("ERROR: Airtime database already exists");
|
||||
}
|
||||
//$this->createDatabase();
|
||||
|
||||
//All we need to do is create the database tables.
|
||||
|
|
Loading…
Reference in New Issue