From 59993788ece76534624634eac0b8bb503e154317 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 27 Nov 2021 11:43:53 +0100 Subject: [PATCH] Added check if table exists to shifts migration --- .../2021_10_12_000000_add_shifts_description.php | 8 ++++++++ tests/Unit/HasDatabase.php | 1 + 2 files changed, 9 insertions(+) diff --git a/db/migrations/2021_10_12_000000_add_shifts_description.php b/db/migrations/2021_10_12_000000_add_shifts_description.php index 15faeb97..d061f3ee 100644 --- a/db/migrations/2021_10_12_000000_add_shifts_description.php +++ b/db/migrations/2021_10_12_000000_add_shifts_description.php @@ -14,6 +14,10 @@ class AddShiftsDescription extends Migration */ public function up() { + if (!$this->schema->hasTable('Shifts')) { + return; + } + $this->schema->table( 'Shifts', function (Blueprint $table) { @@ -27,6 +31,10 @@ class AddShiftsDescription extends Migration */ public function down() { + if (!$this->schema->hasTable('Shifts')) { + return; + } + $this->schema->table( 'Shifts', function (Blueprint $table) { diff --git a/tests/Unit/HasDatabase.php b/tests/Unit/HasDatabase.php index f5c87491..cf9483f3 100644 --- a/tests/Unit/HasDatabase.php +++ b/tests/Unit/HasDatabase.php @@ -54,6 +54,7 @@ trait HasDatabase ['migration' => '2020_09_12_000000_create_welcome_angel_permissions_group'], ['migration' => '2020_12_28_000000_oauth_set_identifier_binary'], ['migration' => '2021_08_26_000000_add_shirt_edit_permissions'], + ['migration' => '2021_10_12_000000_add_shifts_description'], ] );