1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:44:02 +00:00

Assert createDatabase() success

Pretty much all errors that can happen in createDatabase() end up
throwing an exception, however the function still does return a boolean
(it bubbles up the value from the underlying $conn->statement() call)
which should be checked in at least some way.
This commit is contained in:
Samuel Štancl 2025-09-01 21:09:47 +02:00
parent 151e81b412
commit ddf83c4b55
No known key found for this signature in database
GPG key ID: BA146259A1E16C57

View file

@ -40,7 +40,7 @@ class CreateDatabase implements ShouldQueue
try {
$databaseManager->ensureTenantCanBeCreated($this->tenant);
$this->tenant->database()->manager()->createDatabase($this->tenant);
assert($this->tenant->database()->manager()->createDatabase($this->tenant) === true);
event(new DatabaseCreated($this->tenant));
} catch (TenantDatabaseAlreadyExistsException | TenantDatabaseUserAlreadyExistsException $e) {