mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 15:54:03 +00:00
Use config charset and collation for MySQL (#180)
* Use config charset and collation for MySQL * respect code styling
This commit is contained in:
parent
3e78410d8a
commit
58fbdd5281
1 changed files with 4 additions and 1 deletions
|
|
@ -20,7 +20,10 @@ class MySQLDatabaseManager implements TenantDatabaseManager
|
||||||
|
|
||||||
public function createDatabase(string $name): bool
|
public function createDatabase(string $name): bool
|
||||||
{
|
{
|
||||||
return $this->database->statement("CREATE DATABASE `$name` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
|
$charset = $this->database->getConfig('charset');
|
||||||
|
$collation = $this->database->getConfig('collation');
|
||||||
|
|
||||||
|
return $this->database->statement("CREATE DATABASE `$name` CHARACTER SET `$charset` COLLATE `$collation`");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteDatabase(string $name): bool
|
public function deleteDatabase(string $name): bool
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue