We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90fa20c commit ed6f85cCopy full SHA for ed6f85c
src/Tempest/Database/src/Migrations/MigrationManager.php
@@ -34,10 +34,13 @@ public function up(): void
34
{
35
try {
36
$existingMigrations = Migration::all();
37
- } catch (PDOException) {
38
- $this->executeUp(new CreateMigrationsTable());
39
-
40
- $existingMigrations = Migration::all();
+ } catch (PDOException $pdoException) {
+ if ($pdoException->getCode() === $this->databaseConfig->dialect->tableNotFoundCode() && str_contains($pdoException->getMessage(), 'table')) {
+ $this->executeUp(new CreateMigrationsTable());
+ $existingMigrations = Migration::all();
41
+ } else {
42
+ throw $pdoException;
43
+ }
44
}
45
46
$existingMigrations = array_map(
0 commit comments