@@ -109,19 +109,19 @@ public function dropAll(): void
109109 $ tables = $ this ->getTableDefinitions ();
110110
111111 // Disable foreign key checks
112- new SetForeignKeyChecksStatement (enable: false )->execute ($ this ->dialect );
112+ new SetForeignKeyChecksStatement (enable: false )->execute ($ this ->dialect , $ this -> onDatabase );
113113
114114 // Drop each table
115115 foreach ($ tables as $ table ) {
116- new DropTableStatement ($ table ->name )->execute ($ this ->dialect );
116+ new DropTableStatement ($ table ->name )->execute ($ this ->dialect , $ this -> onDatabase );
117117
118118 event (new TableDropped ($ table ->name ));
119119 }
120120 } catch (Throwable $ throwable ) {
121121 event (new FreshMigrationFailed ($ throwable ));
122122 } finally {
123123 // Enable foreign key checks
124- new SetForeignKeyChecksStatement (enable: true )->execute ($ this ->dialect );
124+ new SetForeignKeyChecksStatement (enable: true )->execute ($ this ->dialect , $ this -> onDatabase );
125125 }
126126 }
127127
@@ -249,15 +249,15 @@ public function executeDown(MigrationInterface $migration): void
249249 // TODO: don't just disable FK checking when executing down
250250
251251 // Disable foreign key checks
252- new SetForeignKeyChecksStatement (enable: false )->execute ($ this ->dialect );
252+ new SetForeignKeyChecksStatement (enable: false )->execute ($ this ->dialect , $ this -> onDatabase );
253253
254254 $ this ->database ->execute ($ query );
255255
256256 // Disable foreign key checks
257- new SetForeignKeyChecksStatement (enable: true )->execute ($ this ->dialect );
257+ new SetForeignKeyChecksStatement (enable: true )->execute ($ this ->dialect , $ this -> onDatabase );
258258 } catch (PDOException $ pdoException ) {
259259 // Disable foreign key checks
260- new SetForeignKeyChecksStatement (enable: true )->execute ($ this ->dialect );
260+ new SetForeignKeyChecksStatement (enable: true )->execute ($ this ->dialect , $ this -> onDatabase );
261261
262262 event (new MigrationFailed ($ migration ->name , $ pdoException ));
263263
0 commit comments