From 2047a5009cab39859093e302b0474ad9aa8e9ae1 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Thu, 21 Nov 2024 17:49:10 +0100 Subject: [PATCH] prevent empty migration warning --- Migrations/Version20240917151424.php | 3 +++ Migrations/Version20240917151425.php | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Migrations/Version20240917151424.php b/Migrations/Version20240917151424.php index 2cac81d..fc4f27d 100644 --- a/Migrations/Version20240917151424.php +++ b/Migrations/Version20240917151424.php @@ -28,10 +28,13 @@ public function up(Schema $schema): void // likely an older installation without the latest features, only import the columns available since 2020 $this->addSql('INSERT INTO kimai2_customer_portals (`share_key`, `project_id`, `customer_id`, `password`, `entry_user_visible`, `entry_rate_visible`, `record_merge_mode`, `annual_chart_visible`, `monthly_chart_visible`) SELECT `share_key`, `project_id`, null, `password`, `entry_user_visible`, `entry_rate_visible`, `record_merge_mode`, `annual_chart_visible`, `monthly_chart_visible` FROM kimai2_shared_project_timesheets'); + } else { + $this->preventEmptyMigrationWarning(); } } public function down(Schema $schema): void { + $this->preventEmptyMigrationWarning(); } } diff --git a/Migrations/Version20240917151425.php b/Migrations/Version20240917151425.php index 8a8cd9a..5ba8b7b 100644 --- a/Migrations/Version20240917151425.php +++ b/Migrations/Version20240917151425.php @@ -24,15 +24,22 @@ public function getDescription(): string public function up(Schema $schema): void { + $sawTable = false; if ($schema->hasTable('kimai2_shared_project_timesheets')) { $schema->dropTable('kimai2_shared_project_timesheets'); + $sawTable = true; } if ($schema->hasTable('bundle_migration_shared_project_timesheets')) { $schema->dropTable('bundle_migration_shared_project_timesheets'); + $sawTable = true; + } + if (!$sawTable) { + $this->preventEmptyMigrationWarning(); } } public function down(Schema $schema): void { + $this->preventEmptyMigrationWarning(); } }