From f3281b218f4cc23eff61caf5482a7f34dbfe66a2 Mon Sep 17 00:00:00 2001 From: Jellyfrog Date: Tue, 14 Jun 2022 15:01:07 +0200 Subject: [PATCH] Fix some broken migrations (#14040) --- .../2019_05_30_225937_device_groups_rewrite.php | 12 +++++++----- ...21_12_02_100709_remove_ports_stp_unique_index.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/database/migrations/2019_05_30_225937_device_groups_rewrite.php b/database/migrations/2019_05_30_225937_device_groups_rewrite.php index a88d1b4bda..e9660dd3d3 100644 --- a/database/migrations/2019_05_30_225937_device_groups_rewrite.php +++ b/database/migrations/2019_05_30_225937_device_groups_rewrite.php @@ -28,10 +28,12 @@ class DeviceGroupsRewrite extends Migration */ public function down() { -// Schema::table('device_groups', function (Blueprint $table) { -// $table->string('desc')->change(); -// $table->dropColumn(['type', 'rules']); -// $table->text('params')->nullable()->after('pattern'); -// }); + if (\LibreNMS\DB\Eloquent::getDriver() !== 'sqlite') { + Schema::table('device_groups', function (Blueprint $table) { + $table->string('desc')->change(); + $table->dropColumn(['type', 'rules']); + $table->text('params')->nullable()->after('pattern'); + }); + } } } diff --git a/database/migrations/2021_12_02_100709_remove_ports_stp_unique_index.php b/database/migrations/2021_12_02_100709_remove_ports_stp_unique_index.php index b805a83d40..1bc1635176 100644 --- a/database/migrations/2021_12_02_100709_remove_ports_stp_unique_index.php +++ b/database/migrations/2021_12_02_100709_remove_ports_stp_unique_index.php @@ -26,7 +26,7 @@ class RemovePortsStpUniqueIndex extends Migration public function down() { Schema::table('ports_stp', function (Blueprint $table) { - $table->unique(['device_id', 'port_index']); + $table->unique(['device_id', 'port_id']); }); } }