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