1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 18:34:04 +00:00

Delete complete todos

This commit is contained in:
lukinovec 2023-05-23 10:28:59 +02:00
parent ed688b6f87
commit 5aed290de6

View file

@ -38,8 +38,6 @@ class CreatePostgresUserForTenant implements ShouldQueue
$password = $this->tenant->database()->getPassword() ?? 'password'; $password = $this->tenant->database()->getPassword() ?? 'password';
// Create the user only if it doesn't already exist // Create the user only if it doesn't already exist
// todo1 Create permissions for the user (e.g. permission to create records)
// todo1 Switch to the Postgres user on TenancyInitialized (purge central DB connection, change credentials in database.connections.pgsql, change database.connections.central to the pgsql connection)
if (! count(DB::select("SELECT usename FROM pg_user WHERE usename = '$name';")) > 0) { if (! count(DB::select("SELECT usename FROM pg_user WHERE usename = '$name';")) > 0) {
DB::statement("CREATE USER \"$name\" LOGIN PASSWORD '$password';"); DB::statement("CREATE USER \"$name\" LOGIN PASSWORD '$password';");
} }