From 012760cdfa9a9e48ecb1a558b1d6f4b8312b8639 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 9 Aug 2024 23:41:36 +0600 Subject: [PATCH] pkp/pkp-lib#9892 moved the foreign key check form trait to core pkp migration class --- classes/install/Upgrade.php | 5 +++-- classes/migration/upgrade/v3_4_0/I6093_AddForeignKeys.php | 3 --- classes/migration/upgrade/v3_4_0/PreflightCheckMigration.php | 3 --- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/classes/install/Upgrade.php b/classes/install/Upgrade.php index fed8c7acdc2..a85a4450a68 100644 --- a/classes/install/Upgrade.php +++ b/classes/install/Upgrade.php @@ -18,6 +18,7 @@ use APP\core\Application; use APP\template\TemplateManager; +use Illuminate\Support\Facades\Schema; use PKP\db\DAORegistry; use PKP\install\Installer; use PKP\navigationMenu\NavigationMenuItemDAO; @@ -90,7 +91,7 @@ public function clearCssCache() */ public function migrateStaticPagesToNavigationMenuItems() { - if ($this->tableExists('static_pages')) { + if (Schema::hasTable('static_pages')) { $contextDao = Application::getContextDAO(); $navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO'); /** @var NavigationMenuItemDAO $navigationMenuItemDao */ @@ -147,4 +148,4 @@ public function _fileStageToPath($fileStage) if (!PKP_STRICT_MODE) { class_alias('\APP\install\Upgrade', '\Upgrade'); -} \ No newline at end of file +} diff --git a/classes/migration/upgrade/v3_4_0/I6093_AddForeignKeys.php b/classes/migration/upgrade/v3_4_0/I6093_AddForeignKeys.php index e8422f13736..f26ed6fe060 100644 --- a/classes/migration/upgrade/v3_4_0/I6093_AddForeignKeys.php +++ b/classes/migration/upgrade/v3_4_0/I6093_AddForeignKeys.php @@ -16,12 +16,9 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -use PKP\core\traits\HasForeignKey; class I6093_AddForeignKeys extends \PKP\migration\upgrade\v3_4_0\I6093_AddForeignKeys { - use HasForeignKey; - protected function getContextTable(): string { return 'journals'; diff --git a/classes/migration/upgrade/v3_4_0/PreflightCheckMigration.php b/classes/migration/upgrade/v3_4_0/PreflightCheckMigration.php index b596188d355..eeee680aab7 100644 --- a/classes/migration/upgrade/v3_4_0/PreflightCheckMigration.php +++ b/classes/migration/upgrade/v3_4_0/PreflightCheckMigration.php @@ -19,13 +19,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -use PKP\core\traits\HasForeignKey; use Throwable; class PreflightCheckMigration extends \PKP\migration\upgrade\v3_4_0\PreflightCheckMigration { - use HasForeignKey; - public function up(): void { parent::up();