mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:34:03 +00:00
[3.x] DB users (#382)
* Initial draft * Apply fixes from StyleCI * Use CI on master branch too * Pass correct argument to queued DB creators/deleters * Apply fixes from StyleCI * Remove new interface from MySQLDBManager * Make phpunit run * Apply fixes from StyleCI * Fix static property * Default databaseName * Use database transactions for creating users & granting permissions * Apply fixes from StyleCI * Get old tests to pass * Apply fixes from StyleCI * Add tests for PermissionControlledMySQLDatabaseManager * Apply fixes from StyleCI * Write test for extra config, fix bug with extra config * Apply fixes from StyleCI
This commit is contained in:
parent
60665517a0
commit
3bb2759fe2
41 changed files with 756 additions and 286 deletions
|
|
@ -10,6 +10,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
|||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Stancl\Tenancy\Contracts\TenantDatabaseManager;
|
||||
use Stancl\Tenancy\Tenant;
|
||||
|
||||
class QueuedTenantDatabaseDeleter implements ShouldQueue
|
||||
{
|
||||
|
|
@ -18,20 +19,13 @@ class QueuedTenantDatabaseDeleter implements ShouldQueue
|
|||
/** @var TenantDatabaseManager */
|
||||
protected $databaseManager;
|
||||
|
||||
/** @var string */
|
||||
protected $databaseName;
|
||||
/** @var Tenant */
|
||||
protected $tenant;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param TenantDatabaseManager $databaseManager
|
||||
* @param string $databaseName
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(TenantDatabaseManager $databaseManager, string $databaseName)
|
||||
public function __construct(TenantDatabaseManager $databaseManager, Tenant $tenant)
|
||||
{
|
||||
$this->databaseManager = $databaseManager;
|
||||
$this->databaseName = $databaseName;
|
||||
$this->tenant = $tenant;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +35,6 @@ class QueuedTenantDatabaseDeleter implements ShouldQueue
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->databaseManager->deleteDatabase($this->databaseName);
|
||||
$this->databaseManager->deleteDatabase($this->tenant);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue