mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 05:34:04 +00:00
feat: Add charset and collation support to PostgreSQLDatabaseManager
This commit is contained in:
parent
e3701f1cc1
commit
3b38bc4e4e
1 changed files with 5 additions and 1 deletions
|
|
@ -10,7 +10,11 @@ class PostgreSQLDatabaseManager extends TenantDatabaseManager
|
|||
{
|
||||
public function createDatabase(TenantWithDatabase $tenant): bool
|
||||
{
|
||||
return $this->connection()->statement("CREATE DATABASE \"{$tenant->database()->getName()}\" WITH TEMPLATE=template0");
|
||||
$database = $tenant->database()->getName();
|
||||
$charset = $this->connection()->getConfig('charset');
|
||||
$collation = $this->connection()->getConfig('collation');
|
||||
|
||||
return $this->connection()->statement("CREATE DATABASE \"{$database}\" WITH TEMPLATE=template0 ENCODING='{$charset}' LC_COLLATE='{$collation}' LC_CTYPE='{$collation}'");
|
||||
}
|
||||
|
||||
public function deleteDatabase(TenantWithDatabase $tenant): bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue