Skip to content

Commit f0c534d

Browse files
committed
test(Database): safely drop Oracle procedures and packages in migration down
1 parent c05d247 commit f0c534d

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

‎tests/_support/Database/Migrations/20160428212500_Create_test_tables.php‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,25 @@ public function down(): void
196196
}
197197

198198
if ($this->db->DBDriver === 'OCI8') {
199-
$this->db->query('DROP PROCEDURE one');
200-
$this->db->query('DROP PROCEDURE plus');
201-
$this->db->query('DROP PACKAGE BODY calculator');
199+
try {
200+
$this->db->query('DROP PROCEDURE one');
201+
} catch (Throwable) {
202+
}
203+
204+
try {
205+
$this->db->query('DROP PROCEDURE plus');
206+
} catch (Throwable) {
207+
}
208+
209+
try {
210+
$this->db->query('DROP PACKAGE BODY calculator');
211+
} catch (Throwable) {
212+
}
213+
214+
try {
215+
$this->db->query('DROP PACKAGE calculator');
216+
} catch (Throwable) {
217+
}
202218
}
203219
}
204220
}

0 commit comments

Comments
 (0)