Skip to content

Commit

Permalink
pkp/pkp-lib#8333 Added migration to create extra foreign keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Jun 7, 2023
1 parent 17a1fbb commit f7d2436
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions classes/migration/upgrade/v3_4_0/I8333_AddMissingForeignKeys.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* @file classes/migration/upgrade/v3_4_0/I8333_AddMissingForeignKeys.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 I8333_AddMissingForeignKeys
*
* @brief Upgrade/downgrade operations for introducing foreign key definitions to existing database relationships.
*/

namespace APP\migration\upgrade\v3_4_0;

class I8333_AddMissingForeignKeys extends \PKP\migration\upgrade\v3_4_0\I8333_AddMissingForeignKeys
{
protected function getContextTable(): string
{
return 'journals';
}

protected function getContextKeyField(): string
{
return 'journal_id';
}

protected function getContextSettingsTable(): string
{
return 'journal_settings';
}
}
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
<migration class="PKP\migration\upgrade\v3_4_0\I9039_DropDeprecatedFields"/>
<migration class="APP\migration\upgrade\v3_4_0\I8933_EventLogLocalized"/>
<migration class="APP\migration\upgrade\v3_4_0\I7470_FixDeprecatedFileStage"/>
<migration class="APP\migration\upgrade\v3_4_0\I8333_AddMissingForeignKeys" />
<note file="docs/release-notes/README-3.4.0" />
</upgrade>

Expand Down

0 comments on commit f7d2436

Please sign in to comment.