1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 20:54:03 +00:00

Fix job & test

This commit is contained in:
lukinovec 2023-04-25 12:33:29 +02:00
parent 4eab27e1f0
commit ae25e25715
2 changed files with 7 additions and 7 deletions

View file

@ -38,7 +38,7 @@ class CreatePostgresUserForTenant implements ShouldQueue
$password = $this->tenant->database()->getPassword() ?? 'password';
// Create the user only if it doesn't already exist
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';");
}
}