public function SqlBase::drop_or_create

8.0.x SqlBase.php public SqlBase::drop_or_create()
7.x SqlBase.php public SqlBase::drop_or_create()
master SqlBase.php public SqlBase::drop_or_create()

Drop all tables (if DB exists) or CREATE target database.

return boolean TRUE or FALSE depending on success.

File

lib/Drush/Sql/SqlBase.php, line 257

Namespace

Drush\Sql

Class

SqlBase

Code

public function drop_or_create() {
  if ($this->db_exists()) {
    $this->drop($this->listTables());
  }
  else {
    $this->createdb();
  }
}