From 3858e1cf9774ec847f861021bba4910bcf723d8a Mon Sep 17 00:00:00 2001 From: Dimitris Efstathiou Date: Tue, 14 Feb 2023 18:05:12 +0200 Subject: [PATCH] pkp/pkp-lib#8598 DB Migration fix --- classes/migration/upgrade/v3_4_0/MergeLocalesMigration.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/migration/upgrade/v3_4_0/MergeLocalesMigration.php b/classes/migration/upgrade/v3_4_0/MergeLocalesMigration.php index ee94e20e1eb..7ebc3906fb2 100644 --- a/classes/migration/upgrade/v3_4_0/MergeLocalesMigration.php +++ b/classes/migration/upgrade/v3_4_0/MergeLocalesMigration.php @@ -38,7 +38,7 @@ public function up(): void // All _settings tables. $settingsTables = $this->getSettingsTables(); foreach ($settingsTables as $settingsTable => $settingsTableIdColumn) { - if (Schema::hasColumn($settingsTable, 'locale')) { + if (Schema::hasTable($settingsTable) && Schema::hasColumn($settingsTable, 'locale')) { $settingsValues = DB::table($settingsTable) ->select([$settingsTableIdColumn, 'locale', 'setting_name']) ->get(); @@ -63,7 +63,7 @@ public function up(): void ->where('setting_name', '=', $settingsValue->setting_name) ->where('locale', '=', $defaultLocale) ->first(); - + if (is_null($existingDefaultLocaleValue)) { DB::table($settingsTable) ->where($settingsTableIdColumn, '=', $settingsValue->{$settingsTableIdColumn}) @@ -416,6 +416,7 @@ protected function getSettingsTables(): Collection 'library_file_settings' => 'file_id', 'navigation_menu_item_assignment_settings' => 'navigation_menu_item_assignment_id', 'navigation_menu_item_settings' => 'navigation_menu_item_id', + 'notification_settings' => 'notification_id', 'notification_subscription_settings' => 'setting_id', 'plugin_settings' => 'context_id', 'publication_settings' => 'publication_id',