Skip to content

Commit 0eaa556

Browse files
committed
fix: ensure migration tables are dropped before running migrations in tests.
1 parent 3ac2128 commit 0eaa556

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/TestCase.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,14 @@ protected function createDatabase(): void
175175
$command->dropTable('migration')->execute();
176176
}
177177

178-
$this->runMigrate('down', ['all']);
178+
if ($this->getDb()->getTableSchema('tree', true) !== null) {
179+
$command->dropTable('tree')->execute();
180+
}
181+
182+
if ($this->getDb()->getTableSchema('multiple_tree', true) !== null) {
183+
$command->dropTable('multiple_tree')->execute();
184+
}
185+
179186
$this->runMigrate('up');
180187
}
181188

0 commit comments

Comments
 (0)