| @@ 21-27 (lines=7) @@ | ||
| 18 | $dbDriver->execute("IF NOT EXISTS(select * from sys.databases where name='$database') CREATE DATABASE $database"); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function createDatabase() |
|
| 22 | { |
|
| 23 | $database = preg_replace('~^/~', '', $this->getDbDriver()->getUri()->getPath()); |
|
| 24 | ||
| 25 | $this->getDbDriver()->execute("IF NOT EXISTS(select * from sys.databases where name='$database') CREATE DATABASE $database"); |
|
| 26 | $this->getDbDriver()->execute("USE $database"); |
|
| 27 | } |
|
| 28 | ||
| 29 | public function dropDatabase() |
|
| 30 | { |
|
| @@ 29-35 (lines=7) @@ | ||
| 26 | $this->getDbDriver()->execute("USE $database"); |
|
| 27 | } |
|
| 28 | ||
| 29 | public function dropDatabase() |
|
| 30 | { |
|
| 31 | $database = preg_replace('~^/~', '', $this->getDbDriver()->getUri()->getPath()); |
|
| 32 | ||
| 33 | $this->getDbDriver()->execute("use master"); |
|
| 34 | $this->getDbDriver()->execute("drop database $database"); |
|
| 35 | } |
|
| 36 | ||
| 37 | protected function createTableIfNotExists($database, $table, $createTable) |
|
| 38 | { |
|
| @@ 21-27 (lines=7) @@ | ||
| 18 | $dbDriver->execute("CREATE SCHEMA IF NOT EXISTS `$database` DEFAULT CHARACTER SET utf8 ;"); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function createDatabase() |
|
| 22 | { |
|
| 23 | $database = preg_replace('~^/~', '', $this->getDbDriver()->getUri()->getPath()); |
|
| 24 | ||
| 25 | $this->getDbDriver()->execute("CREATE SCHEMA IF NOT EXISTS `$database` DEFAULT CHARACTER SET utf8 ;"); |
|
| 26 | $this->getDbDriver()->execute("USE `$database`"); |
|
| 27 | } |
|
| 28 | ||
| 29 | public function dropDatabase() |
|
| 30 | { |
|