-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1415 from jonasraoni/bugfix/main/9039-drop-deprec…
…ated-fields Bugfix/main/9039 drop deprecated fields
- Loading branch information
Showing
5 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
classes/migration/upgrade/v3_4_0/I9039_DropDeprecatedFields.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/migration/upgrade/v3_4_0/I9039_DropDeprecatedFields.php | ||
* | ||
* Copyright (c) 2023 Simon Fraser University | ||
* Copyright (c) 2023 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class I9039_DropDeprecatedFields | ||
* | ||
* @brief Drop deprecated fields | ||
*/ | ||
|
||
namespace APP\migration\upgrade\v3_4_0; | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class I9039_DropDeprecatedFields extends \PKP\migration\upgrade\v3_4_0\I9039_DropDeprecatedFields | ||
{ | ||
/** | ||
* Run the migration. | ||
*/ | ||
public function up(): void | ||
{ | ||
parent::up(); | ||
|
||
// Release the index assigned to the column before dropping it | ||
if (DB::getDoctrineSchemaManager()->introspectTable('publication_formats')->hasIndex('publication_format_submission_id')) { | ||
Schema::table('publication_formats', fn (Blueprint $table) => $table->dropIndex('publication_format_submission_id')); | ||
} | ||
|
||
if (Schema::hasColumn('publication_formats', 'submission_id')) { | ||
Schema::dropColumns('publication_formats', 'submission_id'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters