diff --git a/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php b/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php index fe5f85f88..59425aee7 100644 --- a/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php +++ b/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php @@ -30,6 +30,8 @@ class FixUniqueIndexToAccountForHost extends Migration public function down() { Schema::table('databases', function (Blueprint $table) { + $table->dropForeign(['database_host_id']); + $table->dropUnique(['database_host_id', 'database']); $table->dropUnique(['database_host_id', 'username']); diff --git a/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php b/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php index f46481b47..b40f4f55d 100644 --- a/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php +++ b/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php @@ -108,7 +108,8 @@ class MergePermissionsTableIntoSubusers extends Migration foreach (DB::select('SELECT id, permissions FROM subusers') as $datum) { $values = []; foreach (json_decode($datum->permissions, true) as $permission) { - if (! empty($v = $flipped[$permission])) { + $v = $flipped[$permission] ?? null; + if (! empty($v)) { $values[] = $datum->id; $values[] = $v; }