mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-06 15:24:03 +00:00
Default to including pending tenants in MigrateDatabase and SeedDatabase
Now that tenants are created with pending_since right away, the migrate and seed database jobs need to include pending tenants for creating pending tenants to work fully. The jobs can still exclude pending tenants if $includePending is set to false. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
b592d3dad4
commit
66114e6835
2 changed files with 14 additions and 0 deletions
|
|
@ -17,6 +17,12 @@ class MigrateDatabase implements ShouldQueue
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should pending tenants be included while migrating,
|
||||||
|
* regardless of the tenancy.pending.include_in_queries config value.
|
||||||
|
*/
|
||||||
|
public static bool $includePending = true;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected TenantWithDatabase&Model $tenant,
|
protected TenantWithDatabase&Model $tenant,
|
||||||
) {}
|
) {}
|
||||||
|
|
@ -25,6 +31,7 @@ class MigrateDatabase implements ShouldQueue
|
||||||
{
|
{
|
||||||
Artisan::call('tenants:migrate', [
|
Artisan::call('tenants:migrate', [
|
||||||
'--tenants' => [$this->tenant->getTenantKey()],
|
'--tenants' => [$this->tenant->getTenantKey()],
|
||||||
|
'--with-pending' => static::$includePending,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,12 @@ class SeedDatabase implements ShouldQueue
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should pending tenants be included while seeding,
|
||||||
|
* regardless of the tenancy.pending.include_in_queries config value.
|
||||||
|
*/
|
||||||
|
public static bool $includePending = true;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected TenantWithDatabase&Model $tenant,
|
protected TenantWithDatabase&Model $tenant,
|
||||||
) {}
|
) {}
|
||||||
|
|
@ -25,6 +31,7 @@ class SeedDatabase implements ShouldQueue
|
||||||
{
|
{
|
||||||
Artisan::call('tenants:seed', [
|
Artisan::call('tenants:seed', [
|
||||||
'--tenants' => [$this->tenant->getTenantKey()],
|
'--tenants' => [$this->tenant->getTenantKey()],
|
||||||
|
'--with-pending' => static::$includePending,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue