From 64d1333d37238c972fdefd8755f8bbe6ad0529aa Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 21 Apr 2023 14:35:26 +0200 Subject: [PATCH] Add CreatePostgresUserForTenants --- src/Commands/CreatePostgresUserForTenants.php | 25 +++++++++++++++++++ src/TenancyServiceProvider.php | 1 + 2 files changed, 26 insertions(+) create mode 100644 src/Commands/CreatePostgresUserForTenants.php diff --git a/src/Commands/CreatePostgresUserForTenants.php b/src/Commands/CreatePostgresUserForTenants.php new file mode 100644 index 00000000..02991e91 --- /dev/null +++ b/src/Commands/CreatePostgresUserForTenants.php @@ -0,0 +1,25 @@ +runForMultiple($this->getTenants(), function ($tenant) { + CreatePostgresUserForTenant::dispatch(); + }); + + return Command::SUCCESS; + } +} diff --git a/src/TenancyServiceProvider.php b/src/TenancyServiceProvider.php index 871f2cf2..24f8fa1b 100644 --- a/src/TenancyServiceProvider.php +++ b/src/TenancyServiceProvider.php @@ -89,6 +89,7 @@ class TenancyServiceProvider extends ServiceProvider Commands\MigrateFresh::class, Commands\ClearPendingTenants::class, Commands\CreatePendingTenants::class, + Commands\CreatePostgresUserForTenants::class, Commands\CreateRLSPoliciesForTenantTables::class, ]);