mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 02:24:03 +00:00
Merge branch 'master' of https://github.com/archtechx/tenancy into storage-url-conflict-resolution + migrate tests to Pest
This commit is contained in:
commit
8aff44215d
90 changed files with 3867 additions and 3505 deletions
|
|
@ -41,7 +41,13 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
Events\TenantSaved::class => [],
|
||||
Events\UpdatingTenant::class => [],
|
||||
Events\TenantUpdated::class => [],
|
||||
Events\DeletingTenant::class => [],
|
||||
Events\DeletingTenant::class => [
|
||||
JobPipeline::make([
|
||||
Jobs\DeleteDomains::class,
|
||||
])->send(function (Events\DeletingTenant $event) {
|
||||
return $event->tenant;
|
||||
})->shouldBeQueued(false),
|
||||
],
|
||||
Events\TenantDeleted::class => [
|
||||
JobPipeline::make([
|
||||
Jobs\DeleteDatabase::class,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ return [
|
|||
'central_connection' => env('DB_CONNECTION', 'central'),
|
||||
|
||||
/**
|
||||
* Connection used as a "template" for the tenant database connection.
|
||||
* Connection used as a "template" for the dynamically created tenant database connection.
|
||||
* Note: don't name your template connection tenant. That name is reserved by package.
|
||||
*/
|
||||
'template_tenant_connection' => null,
|
||||
|
||||
|
|
@ -60,6 +61,7 @@ return [
|
|||
'sqlite' => Stancl\Tenancy\TenantDatabaseManagers\SQLiteDatabaseManager::class,
|
||||
'mysql' => Stancl\Tenancy\TenantDatabaseManagers\MySQLDatabaseManager::class,
|
||||
'pgsql' => Stancl\Tenancy\TenantDatabaseManagers\PostgreSQLDatabaseManager::class,
|
||||
'sqlsrv' => Stancl\Tenancy\TenantDatabaseManagers\MicrosoftSQLDatabaseManager::class,
|
||||
|
||||
/**
|
||||
* Use this database manager for MySQL to have a DB user created for each tenant database.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class CreateDomainsTable extends Migration
|
|||
$table->string('tenant_id');
|
||||
|
||||
$table->timestamps();
|
||||
$table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue