Skip to content

Commit

Permalink
ignore LogicExceptions while dropping views and types - not all datab…
Browse files Browse the repository at this point in the history
…ases support this.
  • Loading branch information
lupinitylabs committed Sep 5, 2024
1 parent 5ae16fa commit 5a7c3b0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Protector.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,13 +780,14 @@ protected function getProxyForSchemaState($schemaState): SchemaState
};
}

/**
* @throws LogicException
*/
protected function wipeDatabase(Connection $connection): void
{
$connection->getSchemaBuilder()->dropAllViews();
$connection->getSchemaBuilder()->dropAllTables();
$connection->getSchemaBuilder()->dropAllTypes();
try {
$connection->getSchemaBuilder()->dropAllViews();
$connection->getSchemaBuilder()->dropAllTables();
$connection->getSchemaBuilder()->dropAllTypes();
} catch (LogicException) {
// ignore logic exceptions.
}
}
}

0 comments on commit 5a7c3b0

Please sign in to comment.