Skip to content

Commit 628ae39

Browse files
fix: don't disable FOREIGN_KEY_CHECKS if the database is not created yet
1 parent 9c6a699 commit 628ae39

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Services/DatabaseTools/ORMDatabaseTool.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ protected function cleanDatabase(): void
218218

219219
protected function disableForeignKeyChecksIfApplicable(): void
220220
{
221-
if (!$this->isMysql()) {
221+
// Don't disable FOREIGN_KEY_CHECKS is the database is not created yet
222+
if (!$this->isMysql() || !$this->connection->isConnected()) {
222223
return;
223224
}
224225

0 commit comments

Comments
 (0)