Fix migration runner for MySQL DDL implicit commit
This commit is contained in:
parent
883ff30877
commit
aa2f064d08
|
|
@ -34,13 +34,10 @@ foreach ($files as $file) {
|
||||||
throw new RuntimeException("Cannot read {$file}");
|
throw new RuntimeException("Cannot read {$file}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdo->beginTransaction();
|
|
||||||
try {
|
try {
|
||||||
$pdo->exec($sql);
|
$pdo->exec($sql);
|
||||||
$mark->execute(['name' => $name]);
|
$mark->execute(['name' => $name]);
|
||||||
$pdo->commit();
|
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$pdo->rollBack();
|
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user