1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14:04 +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:
Jona Goldman 2019-10-17 07:00:33 -05:00 committed by Samuel Štancl
parent 3e78410d8a
commit 58fbdd5281

View file

@ -20,7 +20,10 @@ class MySQLDatabaseManager implements TenantDatabaseManager
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