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();
|
$this->parsePostParams();
|
||||||
|
|
||||||
//For security, the Airtime Pro provisioning system creates the database for the user.
|
//For security, the Airtime Pro provisioning system creates the database for the user.
|
||||||
// $this->setNewDatabaseConnection();
|
$this->setNewDatabaseConnection();
|
||||||
//if ($this->checkDatabaseExists()) {
|
|
||||||
// throw new Exception("ERROR: Airtime database already exists");
|
//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();
|
//$this->createDatabase();
|
||||||
|
|
||||||
//All we need to do is create the database tables.
|
//All we need to do is create the database tables.
|
||||||
|
|
Loading…
Reference in New Issue