first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-06-08 17:09:23 -04:00
commit df3a033196
17887 changed files with 8637778 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE install SYSTEM "../../lib/pkp/dtd/install.dtd">
<!--
* dbscripts/xml/install.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Installation descriptor file.
-->
<install version="3.4.0.5">
<code function="checkPhpVersion" />
<code function="createDirectories"/>
<migration class="APP\migration\install\JournalsMigration" />
<!-- PKP schema components -->
<migration class="PKP\migration\install\CommonMigration" />
<migration class="PKP\migration\install\GenresMigration" />
<migration class="PKP\migration\install\ControlledVocabMigration" />
<migration class="PKP\migration\install\FailedJobsMigration" />
<migration class="PKP\migration\install\FilesMigration" />
<migration class="PKP\migration\install\JobsMigration" />
<migration class="PKP\migration\install\LogMigration" />
<migration class="PKP\migration\install\NavigationMenusMigration" />
<migration class="PKP\migration\install\NotesMigration" />
<migration class="PKP\migration\install\RolesAndUserGroupsMigration" />
<migration class="PKP\migration\install\SubmissionsMigration" />
<migration class="PKP\migration\install\ReviewFormsMigration" />
<migration class="PKP\migration\install\SubmissionFilesMigration" />
<migration class="PKP\migration\install\ScheduledTasksMigration" />
<migration class="PKP\migration\install\LibraryFilesMigration" />
<migration class="PKP\migration\install\ReviewsMigration" />
<migration class="PKP\migration\install\TemporaryFilesMigration" />
<migration class="PKP\migration\install\TombstoneMigration" />
<migration class="PKP\migration\install\DoiMigration" />
<migration class="PKP\migration\install\InstitutionsMigration" />
<migration class="APP\migration\install\OJSMigration" />
<migration class="PKP\migration\install\MetadataMigration" />
<migration class="PKP\migration\install\AnnouncementsMigration" />
<migration class="PKP\migration\install\CategoriesMigration" />
<migration class="APP\migration\install\MetricsMigration" />
<!-- Other install tasks -->
<code function="createData"/>
<code function="createConfig"/>
<code function="addPluginVersions"/>
<code function="installDefaultNavigationMenus"/>
</install>
+763
View File
@@ -0,0 +1,763 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema SYSTEM "../../lib/pkp/dtd/xmlSchema.dtd">
<!--
* ojs_schema.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* OJS database schema in XML.
* XML-BASED DESCRIPTORS ARE DEPRECATED AND SHOULD NOT BE EDITED.
-->
<schema version="0.2">
<!--
*
* TABLE journals
*
-->
<table name="journals">
<field name="journal_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="path" type="C2" size="32">
<NOTNULL/>
</field>
<field name="seq" type="F">
<NOTNULL/>
<DEFAULT VALUE="0"/>
<descr>Used to order lists of journals</descr>
</field>
<field name="primary_locale" type="C2" size="14">
<NOTNULL/>
</field>
<field name="enabled" type="I1">
<NOTNULL/>
<DEFAULT VALUE="1"/>
<descr>Controls whether or not the journal is considered "live" and will appear on the website. (Note that disabled journals may still be accessible, but only if the user knows the URL.)</descr>
</field>
<descr>Journals and basic journal settings.</descr>
<index name="journals_path">
<col>path</col>
<UNIQUE />
</index>
</table>
<!--
*
* TABLE journal_settings
*
-->
<table name="journal_settings">
<field name="journal_id" type="I8">
<NOTNULL/>
</field>
<field name="locale" type="C2" size="14">
<NOTNULL/>
<DEFAULT VALUE=""/>
</field>
<field name="setting_name" type="C2" size="255">
<NOTNULL/>
</field>
<field name="setting_value" type="X"/>
<field name="setting_type" type="C2" size="6"/>
<descr>Journal settings.</descr>
<index name="journal_settings_journal_id">
<col>journal_id</col>
</index>
<index name="journal_settings_pkey">
<col>journal_id</col>
<col>locale</col>
<col>setting_name</col>
<UNIQUE />
</index>
</table>
<!--
*
* TABLE sections
*
-->
<table name="sections">
<field name="section_id" type="I8">
<KEY />
<AUTOINCREMENT />
</field>
<field name="journal_id" type="I8">
<NOTNULL/>
</field>
<field name="review_form_id" type="I8" />
<field name="seq" type="F">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="editor_restricted" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="meta_indexed" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="meta_reviewed" type="I1">
<NOTNULL/>
<DEFAULT VALUE="1"/>
</field>
<field name="abstracts_not_required" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="hide_title" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="hide_author" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="abstract_word_count" type="I8" />
<descr>Journal sections.</descr>
<index name="sections_journal_id">
<col>journal_id</col>
</index>
</table>
<!--
*
* TABLE section_settings
*
-->
<table name="section_settings">
<field name="section_id" type="I8">
<NOTNULL />
</field>
<field name="locale" type="C2" size="14">
<NOTNULL />
<DEFAULT VALUE=""/>
</field>
<field name="setting_name" type="C2" size="255">
<NOTNULL />
</field>
<field name="setting_value" type="X"/>
<field name="setting_type" type="C2" size="6">
<NOTNULL/>
<descr>(bool|int|float|string|object)</descr>
</field>
<descr>Section-specific settings</descr>
<index name="section_settings_section_id">
<col>section_id</col>
</index>
<index name="section_settings_pkey">
<col>section_id</col>
<col>locale</col>
<col>setting_name</col>
<UNIQUE />
</index>
</table>
<!--
*
* TABLE issues
*
-->
<table name="issues">
<field name="issue_id" type="I8">
<KEY />
<AUTOINCREMENT />
</field>
<field name="journal_id" type="I8">
<NOTNULL />
</field>
<field name="volume" type="I2"/>
<field name="number" type="C2" size="40" />
<field name="year" type="I2"/>
<field name="published" type="I1">
<NOTNULL />
<DEFAULT VALUE="0" />
</field>
<field name="current" type="I1">
<NOTNULL />
<DEFAULT VALUE="0" />
</field>
<field name="date_published" type="T" />
<field name="date_notified" type="T" />
<field name="last_modified" type="T" />
<field name="access_status" type="I1">
<NOTNULL />
<DEFAULT VALUE="1" />
</field>
<field name="open_access_date" type="T" />
<field name="show_volume" type="I1">
<NOTNULL />
<DEFAULT VALUE="0" />
</field>
<field name="show_number" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="show_year" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="show_title" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="style_file_name" type="C2" size="90"/>
<field name="original_style_file_name" type="C2" size="255"/>
<field name="url_path" type="C2" size="64" />
<descr>Journal issues.</descr>
<index name="issues_journal_id">
<col>journal_id</col>
</index>
<index name="issues_url_path">
<col>url_path</col>
</index>
</table>
<!--
*
* TABLE issue_settings
*
-->
<table name="issue_settings">
<field name="issue_id" type="I8">
<NOTNULL />
</field>
<field name="locale" type="C2" size="14">
<NOTNULL />
<DEFAULT VALUE=""/>
</field>
<field name="setting_name" type="C2" size="255">
<NOTNULL />
</field>
<field name="setting_value" type="X"/>
<field name="setting_type" type="C2" size="6">
<NOTNULL/>
</field>
<descr>Locale-specific issue data</descr>
<index name="issue_settings_issue_id">
<col>issue_id</col>
</index>
<index name="issue_settings_pkey">
<col>issue_id</col>
<col>locale</col>
<col>setting_name</col>
<UNIQUE />
</index>
</table>
<!--
*
* TABLE issue_galleys
*
-->
<table name="issue_galleys">
<field name="galley_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="locale" type="C2" size="14"/>
<field name="issue_id" type="I8">
<NOTNULL/>
</field>
<field name="file_id" type="I8">
<NOTNULL/>
</field>
<field name="label" type="C2" size="32"/>
<field name="seq" type="F">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="url_path" type="C2" size="64" />
<descr>Issue galleys.</descr>
<index name="issue_galleys_issue_id">
<col>issue_id</col>
</index>
<index name="issue_galleys_url_path">
<col>url_path</col>
</index>
</table>
<!--
*
* TABLE issue_galley_settings
*
-->
<table name="issue_galley_settings">
<field name="galley_id" type="I8">
<NOTNULL />
</field>
<field name="locale" type="C2" size="14">
<NOTNULL />
<DEFAULT VALUE=""/>
</field>
<field name="setting_name" type="C2" size="255">
<NOTNULL />
</field>
<field name="setting_value" type="X"/>
<field name="setting_type" type="C2" size="6">
<NOTNULL/>
<descr>(bool|int|float|string|object)</descr>
</field>
<descr>Issue galley metadata.</descr>
<index name="issue_galley_settings_galley_id">
<col>galley_id</col>
</index>
<index name="issue_galley_settings_pkey">
<col>galley_id</col>
<col>locale</col>
<col>setting_name</col>
<UNIQUE/>
</index>
</table>
<!--
*
* TABLE issue_files
*
-->
<table name="issue_files">
<field name="file_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="issue_id" type="I8">
<NOTNULL/>
</field>
<field name="file_name" type="C2" size="90">
<NOTNULL/>
</field>
<field name="file_type" type="C2" size="255">
<NOTNULL/>
</field>
<field name="file_size" type="I8">
<NOTNULL/>
</field>
<field name="content_type" type="I8">
<NOTNULL/>
</field>
<field name="original_file_name" type="C2" size="127"/>
<field name="date_uploaded" type="T">
<NOTNULL/>
</field>
<field name="date_modified" type="T">
<NOTNULL/>
</field>
<index name="issue_files_issue_id">
<col>issue_id</col>
</index>
</table>
<!--
* TABLE custom_issue_orders
*
-->
<table name="custom_issue_orders">
<field name="issue_id" type="I8">
<NOTNULL />
</field>
<field name="journal_id" type="I8">
<NOTNULL/>
</field>
<field name="seq" type="F">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<descr>Custom sequencing information for journal issues, when available</descr>
<index name="custom_issue_orders_pkey">
<col>issue_id</col>
<UNIQUE/>
</index>
</table>
<table name="custom_section_orders">
<field name="issue_id" type="I8">
<NOTNULL />
</field>
<field name="section_id" type="I8">
<NOTNULL />
</field>
<field name="seq" type="F">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<descr>Custom sequencing information for journal sections by issue, when available.</descr>
<index name="custom_section_orders_pkey">
<col>issue_id</col>
<col>section_id</col>
<UNIQUE/>
</index>
</table>
<!--
*
* TABLE submission_tombstones
*
-->
<table name="submission_tombstones">
<field name="tombstone_id" type="I8">
<KEY />
<AUTOINCREMENT />
</field>
<field name="submission_id" type="I8">
<NOTNULL />
</field>
<field name="date_deleted" type="T">
<NOTNULL />
</field>
<field name="journal_id" type="I8">
<NOTNULL />
</field>
<field name="section_id" type="I8">
<NOTNULL />
</field>
<field name="set_spec" type="C2" size="255">
<NOTNULL />
</field>
<field name="set_name" type="C2" size="255">
<NOTNULL />
</field>
<field name="oai_identifier" type="C2" size="255">
<NOTNULL />
</field>
<descr>Archived, removed from TOC, unscheduled or unpublished journal articles.</descr>
<index name="submission_tombstones_journal_id">
<col>journal_id</col>
</index>
<index name="submission_tombstones_submission_id">
<col>submission_id</col>
</index>
</table>
<!--
*
* TABLE publications
*
-->
<table name="publications">
<field name="publication_id" type="I8">
<KEY />
<AUTOINCREMENT />
</field>
<field name="access_status" type="I8">
<DEFAULT VALUE="0"/>
</field>
<field name="date_published" type="D"/>
<field name="last_modified" type="T"/>
<field name="locale" type="C2" size="14"/>
<field name="primary_contact_id" type="I8" />
<field name="section_id" type="I8" />
<field name="seq" type="F">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="submission_id" type="I8">
<NOTNULL />
</field>
<field name="status" type="I1">
<NOTNULL/>
<DEFAULT VALUE="1"/><!-- PKPSubmission::STATUS_QUEUED -->
</field>
<field name="url_path" type="C2" size="64" />
<field name="version" type="I8" />
<descr>Publications</descr>
<index name="publications_submission_id">
<col>submission_id</col>
</index>
<index name="publications_section_id">
<col>section_id</col>
</index>
<index name="publications_url_path">
<col>url_path</col>
</index>
</table>
<!--
*
* TABLE publication_galleys
*
-->
<table name="publication_galleys">
<field name="galley_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="locale" type="C2" size="14"/>
<field name="publication_id" type="I8">
<NOTNULL/>
</field>
<field name="label" type="C2" size="255"/>
<field name="file_id" type="I8"/>
<field name="seq" type="F">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="remote_url" type="C2" size="2047"/>
<field name="is_approved" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="url_path" type="C2" size="64" />
<descr>Publication galleys</descr>
<index name="publication_galleys_publication_id">
<col>publication_id</col>
</index>
<index name="publication_galleys_url_path">
<col>url_path</col>
</index>
</table>
<!--
*
* TABLE publication_galley_settings
*
-->
<table name="publication_galley_settings">
<field name="galley_id" type="I8">
<NOTNULL />
</field>
<field name="locale" type="C2" size="14">
<NOTNULL />
<DEFAULT VALUE=""/>
</field>
<field name="setting_name" type="C2" size="255">
<NOTNULL />
</field>
<field name="setting_value" type="X"/>
<descr>Galley metadata.</descr>
<index name="publication_galley_settings_galley_id">
<col>galley_id</col>
</index>
<index name="publication_galley_settings_pkey">
<col>galley_id</col>
<col>locale</col>
<col>setting_name</col>
<UNIQUE/>
</index>
</table>
<!--
*
* TABLE subscription_types
*
-->
<table name="subscription_types">
<field name="type_id" type="I8">
<KEY />
<AUTOINCREMENT />
</field>
<field name="journal_id" type="I8">
<NOTNULL/>
</field>
<field name="cost" type="F">
<NOTNULL/>
</field>
<field name="currency_code_alpha" type="C2" size="3">
<NOTNULL/>
</field>
<field name="non_expiring" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="duration" type="I2">
</field>
<field name="format" type="I2">
<NOTNULL/>
</field>
<field name="institutional" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="membership" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="disable_public_display" type="I1">
<NOTNULL/>
</field>
<field name="seq" type="F">
<NOTNULL/>
</field>
<descr>Subscription types.</descr>
</table>
<!--
*
* TABLE subscription_type_settings
*
-->
<table name="subscription_type_settings">
<field name="type_id" type="I8">
<NOTNULL />
</field>
<field name="locale" type="C2" size="14">
<NOTNULL />
<DEFAULT VALUE=""/>
</field>
<field name="setting_name" type="C2" size="255">
<NOTNULL />
</field>
<field name="setting_value" type="X"/>
<field name="setting_type" type="C2" size="6">
<NOTNULL/>
</field>
<descr>Locale-specific subscription type data</descr>
<index name="subscription_type_settings_type_id">
<col>type_id</col>
</index>
<index name="subscription_type_settings_pkey">
<col>type_id</col>
<col>locale</col>
<col>setting_name</col>
<UNIQUE/>
</index>
</table>
<!--
*
* TABLE subscriptions
*
-->
<table name="subscriptions">
<field name="subscription_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="journal_id" type="I8">
<NOTNULL/>
</field>
<field name="user_id" type="I8">
<NOTNULL/>
</field>
<field name="type_id" type="I8">
<NOTNULL/>
</field>
<field name="date_start" type="D">
</field>
<field name="date_end" type="T">
</field>
<field name="status" type="I1">
<NOTNULL/>
<DEFAULT VALUE="1"/>
</field>
<field name="membership" type="C2" size="40"/>
<field name="reference_number" type="C2" size="40"/>
<field name="notes" type="X"/>
<descr>Journal subscriptions.</descr>
</table>
<!--
*
* TABLE institutional_subscriptions
*
-->
<table name="institutional_subscriptions">
<field name="institutional_subscription_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="subscription_id" type="I8">
<NOTNULL/>
</field>
<field name="institution_name" type="C2" size="255">
<NOTNULL/>
</field>
<field name="mailing_address" type="C2" size="255"/>
<field name="domain" type="C2" size="255"/>
<descr>Journal institutional subscriptions.</descr>
<index name="institutional_subscriptions_subscription_id">
<col>subscription_id</col>
</index>
<index name="institutional_subscriptions_domain">
<col>domain</col>
</index>
</table>
<!--
*
* TABLE institutional_subscription_ip
*
-->
<table name="institutional_subscription_ip">
<field name="institutional_subscription_ip_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="subscription_id" type="I8">
<NOTNULL/>
</field>
<field name="ip_string" type="C2" size="40">
<NOTNULL/>
</field>
<field name="ip_start" type="I8">
<NOTNULL/>
</field>
<field name="ip_end" type="I8">
</field>
<descr>Journal institutional subscription IPs and IP ranges.</descr>
<index name="institutional_subscription_ip_subscription_id">
<col>subscription_id</col>
</index>
<index name="institutional_subscription_ip_start">
<col>ip_start</col>
</index>
<index name="institutional_subscription_ip_end">
<col>ip_end</col>
</index>
</table>
<!--
*
* TABLE queued_payments
*
-->
<table name="queued_payments">
<field name="queued_payment_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="date_created" type="T">
<NOTNULL/>
</field>
<field name="date_modified" type="T">
<NOTNULL/>
</field>
<field name="expiry_date" type="D" />
<field name="payment_data" type="X" />
<descr>Logs queued (unfulfilled) payments.</descr>
</table>
<!--
*
* TABLE completed_payments
*
-->
<table name="completed_payments">
<field name="completed_payment_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="timestamp" type="T">
<NOTNULL/>
</field>
<field name="payment_type" type="I8">
<NOTNULL/>
</field>
<field name="context_id" type="I8">
<NOTNULL/>
</field>
<field name="user_id" type="I8" />
<field name="assoc_id" type="I8" />
<field name="amount" type="F">
<NOTNULL/>
</field>
<field name="currency_code_alpha" type="C2" size="3" />
<field name="payment_method_plugin_name" type="C2" size="80" />
<descr>Logs completed (fulfilled) payments.</descr>
</table>
</schema>
+227
View File
@@ -0,0 +1,227 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE install SYSTEM "../../lib/pkp/dtd/install.dtd">
<!--
* dbscripts/xml/upgrade.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Upgrade descriptor file.
*
-->
<install version="3.4.0.5">
<code function="checkPhpVersion" />
<upgrade minversion="2.0.0.0" maxversion="3.0.9.9">
<!-- OJS < 3.1.0 upgrade unsupported -->
<code function="abort" message="installer.unsupportedUpgradeError" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.0.9">
<data file="dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml" condition="return $installer->columnExists('citations', 'assoc_type');" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.1.9">
<data file="dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml" condition="return $installer->columnExists('users', 'first_name');" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.9.9">
<code function="migrateSubmissionCoverImages" />
<data file="dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml" />
<data file="dbscripts/xml/upgrade/3.2.0_preupdate_versioning_articleGalleySettings.xml" condition="return $installer->tableExists('article_galley_settings');"/>
<data file="dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml" />
<data file="dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.9.9">
<!-- Old schema syncs: These are deprecated! -->
<schema file="lib/pkp/xml/schema/common.xml" />
<schema file="lib/pkp/xml/schema/log.xml" />
<schema file="lib/pkp/xml/schema/announcements.xml" />
<schema file="lib/pkp/xml/schema/scheduledTasks.xml" />
<schema file="lib/pkp/xml/schema/temporaryFiles.xml" />
<schema file="lib/pkp/xml/schema/metadata.xml" />
<schema file="lib/pkp/xml/schema/reviews.xml" />
<schema file="lib/pkp/xml/schema/reviewForms.xml" />
<schema file="lib/pkp/xml/schema/controlledVocab.xml" />
<schema file="lib/pkp/xml/schema/submissions.xml" />
<schema file="lib/pkp/xml/schema/submissionFiles.xml" />
<schema file="lib/pkp/xml/schema/categories.xml" />
<schema file="lib/pkp/xml/schema/notes.xml" />
<schema file="lib/pkp/xml/schema/genres.xml" />
<schema file="lib/pkp/xml/schema/tombstone.xml" />
<schema file="lib/pkp/xml/schema/rolesAndUserGroups.xml" />
<schema file="lib/pkp/xml/schema/metrics.xml" />
<schema file="lib/pkp/xml/schema/libraryFiles.xml" />
<schema file="lib/pkp/xml/schema/navigationMenus.xml" />
<schema file="dbscripts/xml/ojs_schema.xml" />
</upgrade>
<!-- Install default NavigationMenus -->
<code function="installDefaultNavigationMenus" />
<code function="migrateStaticPagesToNavigationMenuItems" />
<upgrade minversion="3.1.0.0" maxversion="3.1.1.9">
<code function="migrateSRLocale" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.9.9">
<!-- migrateUserAndAuthorNames should be after migrateSRLocale -->
<code function="migrateUserAndAuthorNames" condition="return $installer->tableExists('users_tmp');" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.0.9">
<data file="dbscripts/xml/upgrade/3.1.1_update.xml" />
<code function="updateSuppFileMetrics" />
<code function="installEmailTemplate" key="REVISED_VERSION_NOTIFY" locales="ar_IQ,da_DK,en_US,es_ES,fa_IR,fi_FI,fr_CA,fr_FR,id_ID,pt_PT,ru_RU,sv_SE" />
<code function="clearDataCache" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.0.9">
<code function="repairSuppFilesFilestage" />
<code function="fixAuthorGroup" /><!-- Run again after previous invalid fix (#3289) -->
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.0.9">
<note file="docs/release-notes/README-3.1.1" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.1.9">
<data file="dbscripts/xml/upgrade/3.1.2_update.xml" />
<note file="docs/release-notes/README-3.1.2" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.1.4">
<data file="dbscripts/xml/upgrade/event_log_oneclickuserid.xml" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.1.9.9">
<data file="dbscripts/xml/upgrade/3.2.0_stylesheet.xml" />
<data file="dbscripts/xml/upgrade/3.2.0_archiving_settings.xml" />
<data file="dbscripts/xml/upgrade/3.2.0_update.xml" />
<data file="dbscripts/xml/upgrade/3.2.0_navigation_menu_items_locale_change.xml" />
<code function="migrateSiteLocales" />
<code function="migrateSidebarBlocks" />
<code function="migrateSiteStylesheet" />
<code function="migrateMetadataSettings" />
<code function="createLicenseTerms" />
<code function="installEmailTemplate" key="REVIEW_REINSTATE" locales="en_US" />
<code function="changeUserRolesAndStageAssignmentsForStagePermitSubmissionEdit" />
<data file="dbscripts/xml/upgrade/3.2.0_versioning.xml" />
<data file="dbscripts/xml/upgrade/3.2.0_versioning_submissionCategories.xml" condition="return $installer->tableExists('submission_categories');" />
<data file="dbscripts/xml/upgrade/3.2.0_last_activity.xml" />
<data file="dbscripts/xml/upgrade/3.2.0_url_path.xml" />
<code function="setStatsEmailSettings" />
<code function="fixLibraryFiles" />
<code function="installEmailTemplate" key="STATISTICS_REPORT_NOTIFICATION" locales="ar_IQ,ca_ES,cs_CZ,da_DK,de_DE,en_US,es_ES,fi_FI,fr_CA,hi_IN,hu_HU,id_ID,it_IT,ku_IQ,pt_BR,pt_PT,ru_RU,sl_SI,sv_SE,tr_TR,vi_VN,zh_CN" />
<note file="docs/release-notes/README-3.2.0" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.2.0.9">
<data file="dbscripts/xml/upgrade/3.2.1_update.xml" />
<code function="installEmailTemplate" key="ANNOUNCEMENT" locales="ca_ES,cs_CZ,ar_IQ,da_DK,en_US,es_ES,fr_CA,id_ID,it_IT,pt_BR,pt_PT,ru_RU,sl_SI,sv_SE,tr_TR,vi_VN,zh_CN" />
<migration class="PKP\migration\upgrade\PKPv3_2_1SubeditorCategoriesMigration" />
<note file="docs/release-notes/README-3.2.1" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.2.9.9">
<migration class="APP\migration\upgrade\OJSv3_3_0UpgradeMigration" />
<note file="docs/release-notes/README-3.3.0" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.3.9.9">
<migration class="APP\migration\upgrade\v3_4_0\PreflightCheckMigration" fallback="3.3.9.9" />
<migration class="PKP\migration\upgrade\v3_4_0\I8060_UpdateUserLocalesDefaultToEmptyArrayFromNull" />
<migration class="PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString" />
<migration class="APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor" />
<migration class="APP\migration\upgrade\v3_4_0\I6091_AddFilterNamespaces" />
<migration class="APP\migration\upgrade\v3_4_0\I3573_AddPrimaryKeys" />
<migration class="APP\migration\upgrade\v3_4_0\I6093_AddForeignKeys" />
<migration class="APP\migration\upgrade\v3_4_0\MergeLocalesMigration"/>
<migration class="PKP\migration\upgrade\v3_4_0\FailedJobsMigration" />
<migration class="PKP\migration\upgrade\v3_4_0\UpgradeMigration" />
<migration class="APP\migration\upgrade\v3_4_0\I6807_SetLastModified" />
<migration class="APP\migration\upgrade\v3_4_0\I4235_OAISetSpec" />
<migration class="APP\migration\upgrade\v3_4_0\I7264_UpdateEmailTemplates"/>
<migration class="APP\migration\upgrade\v3_4_0\I7596_RemoveNonExpiring"/>
<migration class="APP\migration\upgrade\v3_4_0\I7014_DoiMigration"/>
<migration class="APP\migration\upgrade\v3_4_0\I7265_EditorialDecisions"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7624_StrftimeDeprecation"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7592_RemoveUnusedEmailTemplates"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7126_Galleys"/>
<migration class="APP\migration\upgrade\v3_4_0\I7190_RemoveOrphanFilters" />
<migration class="PKP\migration\upgrade\v3_4_0\I7190_UpdateFilters" />
<migration class="PKP\migration\upgrade\v3_4_0\I6895_CreateNewInstitutionsTables" />
<migration class="PKP\migration\upgrade\v3_4_0\I8073_RemoveNotesWithoutQueriesAndRelatedObjects" />
<migration class="APP\migration\upgrade\v3_4_0\I6895_Institutions" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_OrphanedMetrics" />
<migration class="PKP\migration\upgrade\v3_4_0\I6782_UsageStatsSettings" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_CreateNewMetricsTables" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_MetricsContext" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_MetricsIssue" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_MetricsSubmission" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_MetricsGeo" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_CleanOldMetrics" />
<migration class="APP\migration\upgrade\v3_4_0\I6782_RemovePlugins" />
<migration class="PKP\migration\upgrade\v3_4_0\I7286_BatchesMigration"/>
<migration class="APP\migration\upgrade\v3_4_0\I8151_ExtendSettingValues"/>
<migration class="PKP\migration\upgrade\v3_4_0\I8151_ExtendSettingValues"/>
<migration class="PKP\migration\upgrade\v3_4_0\I2890_EmailTemplatesVarcharLengthUpdate"/>
<migration class="PKP\migration\upgrade\v3_4_0\I2890_AddSetNullForOnDeleteToReviewRoundIdForeign"/>
<migration class="APP\migration\upgrade\v3_4_0\I7901_Duplicate_OAI_IDs"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7366_UpdateUserAPIKeySettings"/>
<migration class="PKP\migration\upgrade\v3_4_0\I8093_UpdateUserGroupRelationTablesFK"/>
<migration class="APP\migration\upgrade\v3_4_0\I7725_DecisionConstantsUpdate"/>
<migration class="PKP\migration\upgrade\v3_4_0\I4789_AddReviewerRequestResentColumns"/>
<migration class="APP\migration\upgrade\v3_4_0\I7796_UpdateCrossrefSchema"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7287_RemoveEmailTemplatesDefault"/>
<migration class="APP\migration\upgrade\v3_4_0\I5716_EmailTemplateAssignments"/>
<migration class="APP\migration\upgrade\v3_4_0\InstallEmailTemplates"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7874_NotificationMetadataModifiedRemove"/>
<migration class="APP\migration\upgrade\v3_4_0\I7191_EditorAssignments"/>
<migration class="APP\migration\upgrade\v3_4_0\I7191_InstallSubmissionHelpDefaults"/>
<migration class="APP\migration\upgrade\v3_4_0\I7191_SubmissionChecklistMigration"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7191_SubmissionProgressType"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7191_ResubscribeSubeditors"/>
<migration class="APP\migration\upgrade\v3_4_0\I8027_DoiVersioning"/>
<migration class="APP\migration\upgrade\v3_4_0\I6306_EnableCategories"/>
<migration class="PKP\migration\upgrade\v3_4_0\I8592_SiteNotificationSubscriptions"/>
<migration class="APP\migration\upgrade\v3_4_0\I6241_RequiredGenres"/>
<migration class="APP\migration\upgrade\v3_4_0\I7128_SectionEntityDAORefactor" />
<migration class="APP\migration\upgrade\v3_4_0\I7513_DoiSettings"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7486_RenameUnconsideredColumnToConsidered"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7486_RemoveItemViewsTable"/>
<migration class="PKP\migration\upgrade\v3_4_0\I8737_SectionEditorsUniqueIndexUpdate"/>
<migration class="PKP\migration\upgrade\v3_4_0\I8508_ConvertCurrentLogFile"/>
<migration class="PKP\migration\upgrade\v3_4_0\I8866_DispatchRegionCodesFixingJobs"/>
<migration class="APP\migration\upgrade\v3_4_0\I8992_FixEmptyUrlPaths"/>
<migration class="APP\migration\upgrade\v3_4_0\I9040_DropSettingType"/>
<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"/>
<note file="docs/release-notes/README-3.4.0" />
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.2.9.9">
<migration class="PKP\migration\upgrade\v3_4_0\I7249_UpdateUsersUniqueIndex_v3_1"/>
</upgrade>
<upgrade minversion="3.3.0.0" maxversion="3.3.9.9">
<migration class="PKP\migration\upgrade\v3_4_0\I7249_UpdateUsersUniqueIndex"/>
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.4.0.1">
<migration class="PKP\migration\upgrade\v3_4_0\I9136_MigrateUniqueSiteId"/>
<migration class="APP\migration\upgrade\v3_4_0\I9231_FixMetricsIndexes"/>
</upgrade>
<upgrade minversion="3.1.0.0" maxversion="3.4.0.4">
<migration class="PKP\migration\upgrade\v3_4_0\I9627_AddUsageStatsTemporaryTablesIndexes"/>
<migration class="PKP\migration\upgrade\v3_4_0\I9535_FixEmptyFileStage"/>
</upgrade>
<!-- update plugin configuration - should be done as the final upgrade task -->
<code function="addPluginVersions" />
</install>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Pre-update operation regarding citations.
*
-->
<data>
<sql>
<!-- to be on the safe side, remove citations that are not associated with a submission -->
<query driver="mysql,mysqli">DELETE FROM cs USING citation_settings cs INNER JOIN citations c ON (cs.citation_id = c.citation_id) WHERE c.assoc_type &lt;&gt; 257</query><!-- ASSOC_TYPE_ARTICLE in OJS 2.4.x -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">DELETE FROM citation_settings cs USING citations c WHERE c.assoc_type &lt;&gt; 257 AND cs.citation_id = c.citation_id</query><!-- ASSOC_TYPE_ARTICLE in OJS 2.4.x -->
<query>DELETE FROM citations WHERE assoc_type &lt;&gt; 257</query><!-- ASSOC_TYPE_ARTICLE in OJS 2.4.x -->
<!-- rename the column assoc_id into submission_id -->
<rename table="citations" column="assoc_id" to="submission_id" />
</sql>
</data>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* 3.1.1_update.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* 3.1.1.0 general updates.
-->
<data>
<sql><!-- pkp/pkp-lib#2441 rename masthead to editorialTeam in journal_settings -->
<query>UPDATE journal_settings SET setting_name = 'editorialTeam' WHERE setting_name = 'masthead'</query>
</sql>
<sql>
<!-- issue #2874: remove citationLookup, citationParser and nlm30 metadata plugin -->
<!-- remove filter_settings -->
<query driver="mysql,mysqli">DELETE FROM fs USING filter_settings fs INNER JOIN filters f ON (fs.filter_id = f.filter_id) INNER JOIN filter_groups fg ON (f.filter_group_id = fg.filter_group_id AND fg.symbolic IN ('citation=>nlm30', 'isbn=>nlm30-element-citation', 'nlm30-article-xml=>nlm23-article-xml', 'nlm30-element-citation=>isbn', 'nlm30-element-citation=>nlm30-element-citation', 'nlm30-element-citation=>nlm30-xml', 'nlm30-element-citation=>plaintext', 'nlm30=>citation', 'plaintext=>nlm30-element-citation', 'submission=>nlm23-article-xml', 'submission=>nlm30-article-xml', 'submission=>reference-list'))</query>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">DELETE FROM filter_settings fs USING filters f, filter_groups fg WHERE fs.filter_id = f.filter_id AND f.filter_group_id = fg.filter_group_id AND fg.symbolic IN ('citation=>nlm30', 'isbn=>nlm30-element-citation', 'nlm30-article-xml=>nlm23-article-xml', 'nlm30-element-citation=>isbn', 'nlm30-element-citation=>nlm30-element-citation', 'nlm30-element-citation=>nlm30-xml', 'nlm30-element-citation=>plaintext', 'nlm30=>citation', 'plaintext=>nlm30-element-citation', 'submission=>nlm23-article-xml', 'submission=>nlm30-article-xml', 'submission=>reference-list')</query>
<!-- remove filters -->
<query driver="mysql,mysqli">DELETE FROM f USING filters f INNER JOIN filter_groups fg ON (f.filter_group_id = fg.filter_group_id AND fg.symbolic IN ('citation=>nlm30', 'isbn=>nlm30-element-citation', 'nlm30-article-xml=>nlm23-article-xml', 'nlm30-element-citation=>isbn', 'nlm30-element-citation=>nlm30-element-citation', 'nlm30-element-citation=>nlm30-xml', 'nlm30-element-citation=>plaintext', 'nlm30=>citation', 'plaintext=>nlm30-element-citation', 'submission=>nlm23-article-xml', 'submission=>nlm30-article-xml', 'submission=>reference-list'))</query>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">DELETE FROM filters f USING filter_groups fg WHERE f.filter_group_id = fg.filter_group_id AND fg.symbolic IN ('citation=>nlm30', 'isbn=>nlm30-element-citation', 'nlm30-article-xml=>nlm23-article-xml', 'nlm30-element-citation=>isbn', 'nlm30-element-citation=>nlm30-element-citation', 'nlm30-element-citation=>nlm30-xml', 'nlm30-element-citation=>plaintext', 'nlm30=>citation', 'plaintext=>nlm30-element-citation', 'submission=>nlm23-article-xml', 'submission=>nlm30-article-xml', 'submission=>reference-list')</query>
<!-- remove filter_groups -->
<query>DELETE FROM filter_groups WHERE symbolic IN ('citation=>nlm30', 'isbn=>nlm30-element-citation', 'nlm30-article-xml=>nlm23-article-xml', 'nlm30-element-citation=>isbn', 'nlm30-element-citation=>nlm30-element-citation', 'nlm30-element-citation=>nlm30-xml', 'nlm30-element-citation=>plaintext', 'nlm30=>citation', 'plaintext=>nlm30-element-citation', 'submission=>nlm23-article-xml', 'submission=>nlm30-article-xml', 'submission=>reference-list')</query>
</sql>
<sql><!-- pkp/pkp-lib#3311 rename subject(EnabledSubmission, EnabledWorkflow, Required) to subjects(EnabledSubmission, EnabledWorkflow, Required) in journal_settings -->
<query>UPDATE journal_settings SET setting_name = 'subjectsEnabledSubmission' WHERE setting_name = 'subjectEnabledSubmission'</query>
<query>UPDATE journal_settings SET setting_name = 'subjectsEnabledWorkflow' WHERE setting_name = 'subjectEnabledWorkflow'</query>
<query>UPDATE journal_settings SET setting_name = 'subjectsRequired' WHERE setting_name = 'subjectRequired'</query>
</sql>
<!-- pkp/pkp-lib#2894 Set 0 review ratings to NULL -->
<sql>
<query>UPDATE review_assignments SET quality = NULL WHERE quality = 0</query>
</sql>
<!-- pkp/pkp-lib#2894 Update old localised user gossip entries -->
<sql>
<query driver="mysql,mysqli">UPDATE users u, (SELECT user_id, GROUP_CONCAT(DISTINCT setting_value SEPARATOR ' ') AS groupedGossips FROM user_settings WHERE setting_name = 'gossip' AND setting_value &lt;&gt; '' GROUP BY user_id) us SET u.gossip = us.groupedGossips WHERE us.user_id = u.user_id</query>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">UPDATE users SET gossip = us.groupedGossips FROM (SELECT user_id, string_agg(DISTINCT setting_value, ' ') AS groupedGossips FROM user_settings WHERE setting_name = 'gossip' AND setting_value &lt;&gt; '' GROUP BY user_id) AS us WHERE us.user_id = users.user_id</query>
<query>DELETE FROM user_settings WHERE setting_name='gossip'</query>
</sql>
<sql><!-- pkp/pkp-lib#3412 Clean up notifications left over from deleted announcements -->
<query driver="mysql,mysqli">DELETE n FROM notifications n LEFT JOIN announcements a ON (n.assoc_id = a.announcement_id) WHERE a.announcement_id IS NULL AND n.assoc_type = 522</query><!-- ASSOC_TYPE_ANNOUNCEMENT -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">DELETE FROM notifications USING notifications n LEFT JOIN announcements a ON (n.assoc_id = a.announcement_id) WHERE a.announcement_id IS NULL AND n.assoc_type = 522 AND notifications.notification_id = n.notification_id</query><!-- ASSOC_TYPE_ANNOUNCEMENT -->
</sql>
<sql><!-- pkp/pkp-lib#3694 migrate DataCite, mEDRA and DOAJ registered status -->
<!-- we cannot differentiate if the registration was done via API or manually in OJS 2, thus we will use status = registered (as the API was eused) and not markedRegistered -->
<!-- DataCite -->
<query>INSERT INTO issue_settings (issue_id, setting_name, setting_value, setting_type) SELECT issue_id, 'datacite::status', 'registered', 'string' FROM issue_settings WHERE setting_name = 'datacite::registeredDoi' AND (setting_value IS NOT NULL OR setting_value &lt;&gt; '') AND issue_id NOT IN (SELECT issue_id FROM issue_settings WHERE setting_name = 'datacite::status')</query>
<query>INSERT INTO submission_settings (submission_id, setting_name, setting_value) SELECT submission_id, 'datacite::status', 'registered' FROM submission_settings WHERE setting_name = 'datacite::registeredDoi' AND (setting_value IS NOT NULL OR setting_value &lt;&gt; '') AND submission_id NOT IN (SELECT submission_id FROM submission_settings WHERE setting_name = 'datacite::status')</query>
<query>INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type) SELECT galley_id, 'datacite::status', 'registered', 'string' FROM submission_galley_settings WHERE setting_name = 'datacite::registeredDoi' AND (setting_value IS NOT NULL OR setting_value &lt;&gt; '') AND galley_id NOT IN (SELECT galley_id FROM submission_galley_settings WHERE setting_name = 'datacite::status')</query>
<!-- mEDRA -->
<query>INSERT INTO issue_settings (issue_id, setting_name, setting_value, setting_type) SELECT issue_id, 'medra::status', 'registered', 'string' FROM issue_settings WHERE setting_name = 'medra::registeredDoi' AND (setting_value IS NOT NULL OR setting_value &lt;&gt; '') AND issue_id NOT IN (SELECT issue_id FROM issue_settings WHERE setting_name = 'medra::status')</query>
<query>INSERT INTO submission_settings (submission_id, setting_name, setting_value) SELECT submission_id, 'medra::status', 'registered' FROM submission_settings WHERE setting_name = 'medra::registeredDoi' AND (setting_value IS NOT NULL OR setting_value &lt;&gt; '') AND submission_id NOT IN (SELECT submission_id FROM submission_settings WHERE setting_name = 'medra::status')</query>
<query>INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type) SELECT galley_id, 'medra::status', 'registered', 'string' FROM submission_galley_settings WHERE setting_name = 'medra::registeredDoi' AND (setting_value IS NOT NULL OR setting_value &lt;&gt; '') AND galley_id NOT IN (SELECT galley_id FROM submission_galley_settings WHERE setting_name = 'medra::status')</query>
<!-- DOAJ -->
<!-- there was no DOAJ API integration in OJS 2, thus only the manuall registration was possible, so we will use status = markedRegistered -->
<query>INSERT INTO submission_settings (submission_id, setting_name, setting_value) SELECT submission_id, 'doaj::status', 'markedRegistered' FROM submission_settings WHERE setting_name = 'doaj::registered' AND (setting_value IS NOT NULL OR setting_value &lt;&gt; '') AND submission_id NOT IN (SELECT submission_id FROM submission_settings WHERE setting_name = 'doaj::status')</query>
</sql>
</data>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Make a copy of the needed users and authors columns in a new DB table, to work with them later, because they will be removed in between.
*
-->
<data>
<sql>
<query>
CREATE TABLE users_tmp AS (SELECT user_id, first_name, last_name, middle_name, salutation, suffix FROM users)
</query>
<query>
CREATE TABLE authors_tmp AS (SELECT author_id, submission_id, first_name, last_name, middle_name, suffix FROM authors)
</query>
</sql>
</data>
+44
View File
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* 3.1.2_update.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* 3.1.2.0 general updates.
-->
<data>
<!-- pkp/pkp-lib#2894 pkp/pkp-lib#4036 Set 0 review ratings to NULL -->
<sql>
<query>UPDATE review_assignments SET quality = NULL WHERE quality = 0</query>
</sql>
<sql><!-- Move User from app-specific to shared lib -->
<query>UPDATE filter_groups SET input_type='class::lib.pkp.classes.user.User[]' WHERE input_type='class::classes.user.User[]'</query>
<query>UPDATE filter_groups SET output_type='class::lib.pkp.classes.user.User[]' WHERE output_type='class::classes.user.User[]'</query>
</sql>
<sql><!-- pkp/pkp-lib#4311 Change CC licenses to HTTPS URLs -->
<query>UPDATE submission_settings SET setting_value='https://creativecommons.org/licenses/by-nc-nd/4.0' WHERE setting_value='http://creativecommons.org/licenses/by-nc-nd/4.0' AND setting_name='licenseUrl'</query>
<query>UPDATE submission_settings SET setting_value='https://creativecommons.org/licenses/by-nc/4.0' WHERE setting_value='http://creativecommons.org/licenses/by-nc/4.0' AND setting_name='licenseUrl'</query>
<query>UPDATE submission_settings SET setting_value='https://creativecommons.org/licenses/by-nc-sa/4.0' WHERE setting_value='http://creativecommons.org/licenses/by-nc-sa/4.0' AND setting_name='licenseUrl'</query>
<query>UPDATE submission_settings SET setting_value='https://creativecommons.org/licenses/by-nd/4.0' WHERE setting_value='http://creativecommons.org/licenses/by-nd/4.0' AND setting_name='licenseUrl'</query>
<query>UPDATE submission_settings SET setting_value='https://creativecommons.org/licenses/by/4.0' WHERE setting_value='http://creativecommons.org/licenses/by/4.0' AND setting_name='licenseUrl'</query>
<query>UPDATE submission_settings SET setting_value='http://creativecommons.org/licenses/by-sa/4.0' WHERE setting_value='http://creativecommons.org/licenses/by-sa/4.0' AND setting_name='licenseUrl'</query>
</sql>
<!-- pkp/pkp-lib#4345 Ensure declined submissions are moved to archive -->
<sql>
<query>UPDATE submissions SET status=4 WHERE submission_id IN (SELECT e1.submission_id FROM edit_decisions e1 LEFT JOIN edit_decisions e2 ON (e2.submission_id = e1.submission_id AND e2.date_decided > e1.date_decided) WHERE e1.decision IN (4, 9) AND e2.edit_decision_id IS NULL) AND status=1</query><!-- STATUS_DECLINED; SUBMISSION_EDITOR_DECISION_DECLINE; SUBMISSION_EDITOR_DECISION_INITIAL_DECLINE; STATUS_QUEUED -->
</sql>
<!-- remove and rename old crossref status settings after the new deposit API integrat -->
<sql>
<query>DELETE FROM submission_settings WHERE setting_name = 'crossref::status' AND setting_value IN ('submitted', 'failed', 'completed')</query>
<query>DELETE FROM submission_settings WHERE setting_name = 'crossref::statusUrl'</query>
<query>UPDATE submission_settings SET setting_value = 'registered' WHERE setting_name = 'crossref::status' AND setting_name = 'found'</query>
</sql>
<sql><!-- pkp/pkp-lib#4561 Enable new metadata injection plugins -->
<query>INSERT INTO plugin_settings (plugin_name, setting_name, setting_value, setting_type, context_id) SELECT 'googlescholarplugin', 'enabled', '1', 'bool', j.journal_id FROM journals j WHERE NOT EXISTS (SELECT ps.plugin_name FROM plugin_settings ps WHERE ps.plugin_name = 'googlescholarplugin' AND ps.context_id = j.journal_id)</query>
<query>INSERT INTO plugin_settings (plugin_name, setting_name, setting_value, setting_type, context_id) SELECT 'dublincoremetaplugin', 'enabled', '1', 'bool', j.journal_id FROM journals j WHERE NOT EXISTS (SELECT ps.plugin_name FROM plugin_settings ps WHERE ps.plugin_name = 'dublincoremetaplugin' AND ps.context_id = j.journal_id)</query>
</sql>
</data>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_archiving_settings.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Remove unused context settings related to archiving plugins. These settings
* were never used, but were saved to the database as part of ArchivingForm's
* tooling for enabling/disabling the plugins from the settings form.
*
-->
<data>
<sql>
<query>
DELETE FROM journal_settings WHERE setting_name='enablePln' OR setting_name='enablePortico';
</query>
</sql>
</data>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Migrate the old date_status_modified column in the submissions table to the
* new date_last_activity column.
*
-->
<data>
<sql>
<query>
UPDATE submissions s SET date_last_activity = (
SELECT date_status_modified FROM temp_last_activity_submissions tlas WHERE tlas.submission_id = s.submission_id
)
</query>
<drop table="temp_last_activity_submissions" />
</sql>
</data>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_navigation_menu_items_locale_change.xml
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Update the locales for default navigation menu items
*
-->
<data>
<!-- pkp/pkp-lib#4214 navigation.submissions locale changed to about.submissions-->
<sql>
<query>UPDATE navigation_menu_item_settings SET setting_value='about.submissions' WHERE setting_name='titleLocaleKey' AND setting_value='navigation.submissions'</query>
</sql>
</data>
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Update the email templates tables to remove unused columns, add a new
* email_id column and primary key, and update outdated role ids for the
* default templates.
*
-->
<data>
<sql><!-- pkp/pkp-lib#4988 Fix obsolete submissionLayoutUrl email variable -->
<query>UPDATE email_templates_default_data SET body=REPLACE(body, '{$submissionLayoutUrl}', '{$submissionUrl}')</query>
<query>UPDATE email_templates_data SET body=REPLACE(body, '{$submissionLayoutUrl}', '{$submissionUrl}')</query>
</sql>
<sql><!-- pkp/pkp-lib#3248 Correct duplication of email signatures -->
<query>UPDATE email_templates_default_data SET body=REPLACE(body, '{$editorialContactSignature}', '') WHERE email_key IN ('EDITOR_ASSIGN', 'REVIEW_CANCEL', 'REVIEW_ACK', 'EDITOR_DECISION_ACCEPT', 'EDITOR_DECISION_SEND_TO_EXTERNAL', 'EDITOR_DECISION_SEND_TO_PRODUCTION', 'EDITOR_DECISION_REVISIONS', 'EDITOR_DECISION_RESUBMIT', 'EDITOR_DECISION_DECLINE', 'EDITOR_DECISION_INITIAL_DECLINE', 'EDITOR_RECOMMENDATION', 'COPYEDIT_REQUEST', 'LAYOUT_REQUEST', 'PROOFREAD_LAYOUT_REQUEST')</query>
<query>UPDATE email_templates_data SET body=REPLACE(body, '{$editorialContactSignature}', '') WHERE email_key IN ('EDITOR_ASSIGN', 'REVIEW_CANCEL', 'REVIEW_ACK', 'EDITOR_DECISION_ACCEPT', 'EDITOR_DECISION_SEND_TO_EXTERNAL', 'EDITOR_DECISION_SEND_TO_PRODUCTION', 'EDITOR_DECISION_REVISIONS', 'EDITOR_DECISION_RESUBMIT', 'EDITOR_DECISION_DECLINE', 'EDITOR_DECISION_INITIAL_DECLINE', 'EDITOR_RECOMMENDATION', 'COPYEDIT_REQUEST', 'LAYOUT_REQUEST', 'PROOFREAD_LAYOUT_REQUEST')</query>
</sql>
<sql>
<query>ALTER TABLE email_templates_data ADD email_id BIGINT</query>
<query driver="mysql,mysqli">UPDATE email_templates_data etd LEFT JOIN email_templates et ON (etd.email_key = et.email_key AND etd.assoc_type = et.assoc_type AND etd.assoc_id = et.assoc_id) SET etd.email_id = et.email_id</query>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">UPDATE email_templates_data SET email_id=email_templates.email_id FROM email_templates WHERE email_templates_data.email_key = email_templates.email_key AND email_templates_data.assoc_type = email_templates.assoc_type AND email_templates_data.assoc_id = email_templates.assoc_id</query>
<query>ALTER TABLE email_templates ADD context_id BIGINT</query>
<query>UPDATE email_templates SET context_id = assoc_id WHERE assoc_type=256 AND assoc_id IS NOT NULL</query>
<dropindex table="email_templates" index="email_templates_assoc" />
<dropindex table="email_templates" index="email_templates_email_key" />
<query>ALTER TABLE email_templates DROP COLUMN assoc_type, DROP COLUMN assoc_id</query>
<!-- 16 = ROLE_ID_MANAGER, 17 = ROLE_ID_SUB_EDITOR, 256 and 512 = unused role ids -->
<query>UPDATE email_templates_default SET from_role_id=16 WHERE from_role_id=17 OR from_role_id=256 OR from_role_id=512</query>
<!-- 16 = ROLE_ID_MANAGER, 17 = ROLE_ID_SUB_EDITOR, 256 and 512 = unused role ids -->
<query>UPDATE email_templates_default SET to_role_id=16 WHERE to_role_id=17 OR to_role_id=256 OR to_role_id=512</query>
<!-- 4097 = ROLE_ID_ASSISTANT, 768 and 8192 = unused role ids -->
<query>UPDATE email_templates_default SET from_role_id=4097 WHERE from_role_id=768 OR from_role_id=8192</query>
<!-- 4097 = ROLE_ID_ASSISTANT, 768 and 8192 = unused role ids -->
<query>UPDATE email_templates_default SET to_role_id=4097 WHERE to_role_id=768 OR to_role_id=8192</query>
</sql>
</data>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Copy the submissions table so we can migrate the date_status_modified
* value to the date_last_activity column
*
-->
<data>
<sql>
<query>CREATE TABLE temp_last_activity_submissions AS SELECT * FROM submissions</query>
</sql>
</data>
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Copy submission data to temporary tables so it can be updated
* after the publication table modifications are made.
*
-->
<data>
<sql>
<query>CREATE TABLE temp_authors AS SELECT * FROM authors</query>
<query>CREATE INDEX temp_authors_s_id ON temp_authors (submission_id)</query>
<query>CREATE INDEX temp_authors_a_s_id ON temp_authors (author_id, submission_id)</query>
<query>CREATE TABLE temp_submissions AS SELECT * FROM submissions</query>
<query>CREATE INDEX temp_submissions_s_id ON temp_submissions (submission_id)</query>
<query>CREATE TABLE temp_submission_galleys AS SELECT * FROM submission_galleys</query>
<query>CREATE INDEX temp_submission_galleys_s_id ON temp_submission_galleys (submission_id)</query>
<query>CREATE TABLE temp_published_submissions AS SELECT * FROM published_submissions</query>
<query>CREATE INDEX temp_published_submissions_s_id ON temp_published_submissions (submission_id)</query>
<query>CREATE TABLE temp_citations AS SELECT * FROM citations</query>
<query>CREATE INDEX temp_citations_s_id ON temp_citations (submission_id)</query>
<query>CREATE INDEX temp_citations_c_s_id ON temp_citations (citation_id, submission_id)</query>
</sql>
<!--
Identify any submissions with PKPSubmission::STATUS_PUBLISHED that are missing a corresponding entry
in the published_submissions table and reset them to PKPSubmission::STATUS_QUEUED. In the past, an
entry in published_submissions was required before a submission would be public. Now
it will be public if it has a status of PKPSubmission::STATUS_PUBLISHED. A submission should never
have PKPSubmission::STATUS_PUBLISHED without a published_submissions entry, but this is a
precautionary measure to prevent unexpectedly making a submission public if the
status value is incorrect for any submissions.
-->
<sql>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">UPDATE submissions SET status=1 FROM submissions AS s LEFT JOIN published_submissions ps ON (ps.submission_id = s.submission_id) WHERE s.submission_id = submissions.submission_id AND s.status=3 AND ps.submission_id IS NULL</query>
<query driver="mysql,mysqli">UPDATE submissions s LEFT JOIN published_submissions ps ON (ps.submission_id = s.submission_id) SET s.status=1 WHERE s.status=3 AND ps.submission_id IS NULL</query>
</sql>
<!-- Modify citations table to refer to publications #5465-->
<sql>
<dropindex table="citations" index="citations_submission" ifexists="true" />
<dropindex table="citations" index="citations_submission_seq" ifexists="true" />
<rename table="citations" column="submission_id" to="publication_id" />
</sql>
</data>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_preupdate_versioning_articleGalleySettings.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Copy submission data to temporary tables so it can be updated
* after the publication table modifications are made.
*
-->
<data>
<sql>
<query>UPDATE article_galley_settings SET locale='nb_NO' WHERE locale='no_NO'</query>
<query>CREATE TABLE submission_galley_settings AS SELECT * FROM article_galley_settings WHERE setting_name &lt;&gt; 'excludeDoi' AND setting_name &lt;&gt; 'excludeURN'</query>
<drop table="article_galley_settings"/>
</sql>
</data>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_stylesheet.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Update the context setting `stylesheet` format to drop the image attributes
* object and replace it with a string referencing the filename. Also remove
* the unused original_style_file_name column from the site table.
*
-->
<data>
<sql>
<query>
UPDATE journal_settings SET setting_value='a:3:{s:4:"name";s:9:"admin.css";s:10:"uploadName";s:14:"styleSheet.css";s:12:"dateUploaded";s:0:"";}' WHERE setting_name='styleSheet';
</query>
<query>
ALTER TABLE site DROP COLUMN original_style_file_name
</query>
</sql>
</data>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* 3.2.0_update.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* 3.2.0.0 general updates.
-->
<data>
<sql><!-- pkp/pkp-lib#2160/4726: Clean up editorial history -->
<query>UPDATE event_log_settings SET setting_name='submissionId' WHERE setting_name='articleId'</query>
<query>UPDATE event_log_settings SET setting_name='submissionId' WHERE setting_name='submission_id'</query>
</sql>
<sql><!-- pkp/pkp-lib#4573 Enable OAI interface by default -->
<!-- PostgreSQL ADODB driver does not seem to properly support dropping constraints -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">ALTER TABLE journal_settings ALTER COLUMN setting_type DROP NOT NULL</query>
<query>INSERT INTO journal_settings (setting_name, setting_value, journal_id) SELECT 'enableOai', '1', j.journal_id FROM journals j WHERE NOT EXISTS (SELECT js.setting_name FROM journal_settings js WHERE js.setting_name = 'enableOai' AND js.journal_id = j.journal_id)</query>
</sql>
<sql><!-- pkp/pkp-lib#5445 Use new setting name for LicenseUrl -->
<query>UPDATE journal_settings SET setting_name='licenseUrl' WHERE setting_name='licenseURL'</query>
<query>UPDATE publication_settings SET setting_name='licenseUrl' WHERE setting_name='licenseURL'</query>
</sql>
<sql><!-- Migrate immersion theme settings stored as context settings to plugin settings -->
<query>
INSERT INTO plugin_settings (plugin_name, context_id, setting_name, setting_value, setting_type)
SELECT 'immersionthemeplugin', js.journal_id, js.setting_name, js.setting_value, 'string'
FROM journal_settings as js
WHERE js.setting_name='immersionAnnouncementsColor'
</query>
<query>
DELETE FROM journal_settings WHERE setting_name='immersionAnnouncementsColor'
</query>
</sql>
<!-- Migrate email templates from email_templates_data to email_templates_settings -->
<sql>
<query>
INSERT INTO email_templates_settings (email_id, locale, setting_value, setting_name)
SELECT email_id, locale, subject, 'subject'
FROM email_templates_data
</query>
<query>
INSERT INTO email_templates_settings (email_id, locale, setting_value, setting_name)
SELECT email_id, locale, body, 'body'
FROM email_templates_data
</query>
<drop table="email_templates_data" />
</sql>
</data>
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_stylesheet.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Create new url_path values from pub-id::publisher-id values. #5430
*
-->
<data>
<sql>
<query>
UPDATE publications as p
SET url_path = (
SELECT ps.setting_value
FROM publication_settings as ps
WHERE ps.publication_id = p.publication_id
AND ps.setting_name = 'pub-id::publisher-id'
)
</query>
<query>
UPDATE issues as i
SET url_path = (
SELECT ist.setting_value
FROM issue_settings as ist
WHERE ist.issue_id = i.issue_id
AND ist.setting_name = 'pub-id::publisher-id'
)
</query>
<query>
UPDATE issue_galleys as ig
SET url_path = (
SELECT igs.setting_value
FROM issue_galley_settings as igs
WHERE igs.galley_id = ig.galley_id
AND igs.setting_name = 'pub-id::publisher-id'
)
</query>
<query>
UPDATE publication_galleys as g
SET url_path = (
SELECT gs.setting_value
FROM publication_galley_settings as gs
WHERE gs.galley_id = g.galley_id
AND gs.setting_name = 'pub-id::publisher-id'
)
</query>
</sql>
</data>
+280
View File
@@ -0,0 +1,280 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_versioning.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Copy submission data to temporary tables so it can be updated
* after the publication table modifications are made.
*
-->
<data>
<sql>
<!-- change date_published from datetime to date before migrating -->
<query driver="mysql,mysqli">ALTER TABLE temp_published_submissions MODIFY COLUMN date_published DATE NULL</query>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">ALTER TABLE temp_published_submissions ALTER COLUMN date_published TYPE DATE</query>
<!-- migrate data to new publications table -->
<query>
INSERT INTO publications (access_status, date_published, last_modified, locale, section_id, seq, submission_id, status, version)
SELECT COALESCE(ps.access_status, 0), COALESCE(ps.date_published, NULL), s.last_modified, s.locale, s.section_id, COALESCE(ps.seq, 0), s.submission_id, s.status, 1
FROM temp_submissions as s
LEFT JOIN temp_published_submissions as ps
ON (s.submission_id = ps.submission_id)
GROUP BY s.submission_id, ps.access_status, ps.date_published, s.last_modified, s.section_id, ps.seq, s.locale, s.status;
</query>
<query>
UPDATE publications as p
SET primary_contact_id = (
SELECT a.author_id
FROM temp_authors as a
WHERE a.submission_id = p.submission_id
AND a.primary_contact = 1
LIMIT 1
)
</query>
<!-- set the current_publication_id column in submissions -->
<query>
UPDATE submissions as s
SET current_publication_id = (
SELECT p.publication_id
FROM publications as p
WHERE s.submission_id = p.submission_id
)
</query>
<!-- migrate submission_settings to publication_settings -->
<query>
INSERT INTO publication_settings(publication_id, locale, setting_name, setting_value)
SELECT s.current_publication_id, ss.locale, ss.setting_name, ss.setting_value
FROM submissions as s
LEFT JOIN submission_settings as ss
ON (ss.submission_id = s.submission_id)
WHERE (
setting_name IN ('abstract', 'cleanTitle', 'copyrightHolder', 'copyrightYear', 'coverage', 'coverImage', 'licenseUrl', 'locale', 'prefix', 'rights', 'source', 'subtitle', 'title', 'type')
OR setting_name LIKE '%pub-id%'
)
</query>
<query>
DELETE FROM submission_settings
WHERE (
setting_name IN ('abstract', 'cleanTitle', 'copyrightHolder', 'copyrightYear', 'coverage', 'coverImage', 'coverImageAltText', 'licenseUrl', 'locale', 'prefix', 'rights', 'source', 'subtitle', 'title', 'type')
OR setting_name LIKE '%pub-id%'
)
</query>
<!-- migrate some data from submissions to publication_settings -->
<query>
INSERT INTO publication_settings(publication_id, setting_name, setting_value)
SELECT s.current_publication_id, 'language', ts.language
FROM submissions as s
LEFT JOIN temp_submissions as ts
ON s.submission_id = ts.submission_id
WHERE ts.language != ''
</query>
<query>
INSERT INTO publication_settings(publication_id, setting_name, setting_value)
SELECT s.current_publication_id, 'citationsRaw', ts.citations
FROM submissions as s
LEFT JOIN temp_submissions as ts
ON s.submission_id = ts.submission_id
WHERE ts.citations IS NOT NULL
</query>
<query>
INSERT INTO publication_settings(publication_id, setting_name, setting_value)
SELECT s.current_publication_id, 'pages', ts.pages
FROM submissions as s
LEFT JOIN temp_submissions as ts
ON s.submission_id = ts.submission_id
WHERE ts.pages IS NOT NULL
</query>
<query>
INSERT INTO publication_settings(publication_id, setting_name, setting_value)
SELECT s.current_publication_id, 'hide_author', ts.hide_author
FROM submissions as s
LEFT JOIN temp_submissions as ts
ON s.submission_id = ts.submission_id
WHERE ts.hide_author IS NOT NULL
</query>
<!-- migrate issue_id from published_submissions to publication settings -->
<query>
INSERT INTO publication_settings(publication_id, setting_name, setting_value)
SELECT s.current_publication_id, 'issueId', ps.issue_id
FROM temp_published_submissions as ps
LEFT JOIN submissions as s
ON ps.submission_id = s.submission_id
WHERE s.current_publication_id IS NOT NULL
</query>
<!-- move some author data to settings table -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">ALTER TABLE author_settings ALTER COLUMN setting_type DROP NOT NULL</query>
<query>
INSERT INTO author_settings(author_id, setting_name, setting_value)
SELECT ta.author_id, 'country', ta.country
FROM temp_authors as ta
</query>
<query>
INSERT INTO author_settings(author_id, setting_name, setting_value)
SELECT ta.author_id, 'url', ta.url
FROM temp_authors as ta
WHERE ta.url IS NOT NULL
</query>
<!-- connect authors to publications -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">
UPDATE authors
SET publication_id = s.current_publication_id
FROM submissions s, temp_authors ta
WHERE authors.author_id = ta.author_id AND s.submission_id = ta.submission_id
</query>
<query driver="mysql,mysqli">
UPDATE authors as a
SET a.publication_id = (
SELECT s.current_publication_id
FROM submissions as s
LEFT JOIN temp_authors as ta
ON s.submission_id = ta.submission_id
WHERE a.author_id = ta.author_id
)
</query>
<!-- move submission_galleys to publication_galleys -->
<query>
INSERT INTO publication_galleys(galley_id, locale, publication_id, label, file_id, seq, remote_url, is_approved)
SELECT tsg.galley_id, tsg.locale, s.current_publication_id, tsg.label, tsg.file_id, tsg.seq, tsg.remote_url, 1
FROM submissions as s, temp_submission_galleys as tsg
WHERE s.submission_id = tsg.submission_id
</query>
<query>
INSERT INTO publication_galley_settings(galley_id, locale, setting_name, setting_value)
SELECT tsgs.galley_id, tsgs.locale, tsgs.setting_name, tsgs.setting_value
FROM submission_galley_settings as tsgs
WHERE tsgs.galley_id IS NOT NULL
</query>
<!-- connect controlled vocab metadata to publications, 1048585 = ASSOC_TYPE_SUBMISSION, 1048588 = ASSOC_TYPE_PUBLICATION -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">
UPDATE controlled_vocabs
SET assoc_type = 1048588, assoc_id = s.current_publication_id
FROM submissions s
WHERE assoc_type = 1048585 AND assoc_id = s.submission_id
</query>
<query driver="mysql,mysqli">
UPDATE controlled_vocabs AS cv,
submissions AS s
SET cv.assoc_type = 1048588, cv.assoc_id = s.current_publication_id
WHERE cv.assoc_type = 1048585 AND s.submission_id = cv.assoc_id
</query>
<!-- connect citations to publications -->
<!-- To avoid collisions per pkp/pkp-lib#5795, first flip to negative, then clean up. -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">
UPDATE citations
SET publication_id = -s.current_publication_id
FROM submissions s
JOIN temp_citations as tc ON (s.submission_id = tc.submission_id)
WHERE citations.citation_id = tc.citation_id
</query>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9"><![CDATA[
UPDATE citations SET publication_id = -publication_id WHERE publication_id < 0
]]></query>
<query driver="mysql,mysqli">
UPDATE citations as c
SET c.publication_id = (
SELECT s.current_publication_id
FROM submissions as s
JOIN temp_citations as tc ON s.submission_id = tc.submission_id
WHERE c.citation_id = tc.citation_id
) ORDER BY c.publication_id ASC
</query>
<!-- update the DOI setting names -->
<query>
UPDATE plugin_settings
SET setting_name='doiPublicationSuffixPattern'
WHERE setting_name='doiSubmissionSuffixPattern'
AND plugin_name='doipubidplugin'
</query>
<query>
UPDATE plugin_settings
SET setting_name='enablePublicationDoi'
WHERE setting_name='enableSubmissionDoi'
AND plugin_name='doipubidplugin'
</query>
<!-- update the URN setting names -->
<query>
UPDATE plugin_settings
SET setting_name='urnPublicationSuffixPattern'
WHERE setting_name='urnSubmissionSuffixPattern'
AND plugin_name='urnpubidplugin'
</query>
<query>
UPDATE plugin_settings
SET setting_name='enablePublicationURN'
WHERE setting_name='enableSubmissionURN'
AND plugin_name='urnpubidplugin'
</query>
<!--
pkp/pkp-lib#7266 Assigned articles missing from future issues after upgrade to OJS 3.3.0-8
Constants:
- STATUS_SCHEDULED = 5
- WORKFLOW_STAGE_ID_EDITING = 4
- WORKFLOW_STAGE_ID_PRODUCTION = 5
-->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">
UPDATE publications as p
SET status = 5
WHERE ctid IN (
SELECT p.ctid
FROM publications as p
LEFT JOIN publication_settings as pss ON p.publication_id = pss.publication_id
LEFT JOIN submissions as s ON p.submission_id = s.submission_id
WHERE pss.setting_name = 'issueId'
AND pss.setting_value IS NOT NULL
AND p.status = 1
AND s.stage_id IN (4, 5)
)
</query>
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">
UPDATE "submissions" as "s"
SET "status" = 5
WHERE "ctid" IN (
SELECT "s"."ctid"
FROM "submissions" as "s"
LEFT JOIN "publications" as "p" ON "s"."submission_id" = "p"."submission_id"
LEFT JOIN "publication_settings" as "pss" ON "p"."publication_id" = "pss"."publication_id"
WHERE "pss"."setting_name" = 'issueId'
AND "pss"."setting_value" IS NOT NULL
AND "s"."status" = 1
AND "s"."stage_id" IN (4,5)
)
</query>
<query driver="mysql,mysqli">
UPDATE publications as p
LEFT JOIN publication_settings as pss ON p.publication_id = pss.publication_id
LEFT JOIN submissions as s ON p.submission_id = s.submission_id
SET p.status = 5, s.status = 5
WHERE pss.setting_name = 'issueId'
AND pss.setting_value IS NOT NULL
AND p.status = 1
AND s.stage_id in (4, 5)
</query>
<!-- remove deprecated and temporary tables. should be last commands -->
<drop table="submission_galleys" />
<drop table="submission_galley_settings" />
<drop table="published_submissions" />
<drop table="temp_authors" />
<drop table="temp_submissions" />
<drop table="temp_submission_galleys" />
<drop table="temp_published_submissions" />
<drop table="temp_citations" />
</sql>
</data>
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.0_versioning_submissionCategories.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Adapt submission_categories data for publication_categories.
*
-->
<data>
<sql>
<query>
INSERT INTO publication_categories(publication_id, category_id)
SELECT s.current_publication_id, sc.category_id
FROM submission_categories as sc
LEFT JOIN submissions as s ON s.submission_id = sc.submission_id
WHERE s.current_publication_id IS NOT NULL
</query>
</sql>
<sql>
<drop table="submission_categories" />
</sql>
</data>
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* dbscripts/xml/upgrade/3.2.1_update.xml
*
* Copyright (c) 2013-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Update queries for OJS 3.2.1.
-->
<data>
<sql><!-- pkp/pkp-lib#5617 Make all theme plugins lazy load plugins -->
<query>UPDATE versions SET lazy_load = 1 WHERE product_type = 'plugins.themes'</query>
</sql>
<sql><!-- pkp/pkp-lib#5573: Filters need updating for shift to Submissions instead of Articles -->
<query>UPDATE filter_groups SET input_type = 'class::classes.submission.Submission' WHERE input_type = 'class::classes.article.Article'</query>
<query>UPDATE filter_groups SET output_type = 'class::classes.submission.Submission' WHERE output_type = 'class::classes.article.Article'</query>
</sql>
<sql><!-- pkp/pkp-lib#5681: Filters need updating for shift to Submissions instead of Articles -->
<query>UPDATE filter_groups SET input_type = 'class::classes.submission.Submission[]' WHERE input_type = 'class::classes.article.Article[]'</query>
<query>UPDATE filter_groups SET output_type = 'class::classes.submission.Submission[]' WHERE output_type = 'class::classes.article.Article[]'</query>
</sql>
</data>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* event_log_oneclickuserid.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Add missing user id on event logs from 'one-click' reviews.
-->
<data>
<sql>
<query driver="mysql,mysqli"> <!-- pkp/pkp-lib#4263 -->
UPDATE event_log el JOIN ( event_log_settings els JOIN review_assignments ra ) ON ( els.log_id=el.log_id AND els.setting_name='reviewId' AND ra.review_id=els.setting_value )
SET el.user_id = ra.reviewer_id
WHERE el.user_id=0 AND el.event_type IN ( 1073741830, 1073741831, 1073741833, 1073741843 )
</query> <!-- SUBMISSION_LOG_REVIEW_ACCEPT, SUBMISSION_LOG_REVIEW_DECLINE, SUBMISSION_LOG_REVIEW_UNCONSIDERED, SUBMISSION_LOG_REVIEW_FILE -->
<query driver="postgres,postgres64,postgres7,postgres8,postgres9">
UPDATE event_log el
SET user_id = ra.reviewer_id
FROM event_log_settings els, review_assignments ra
WHERE
el.user_id=0 AND el.event_type IN ( 1073741830, 1073741831, 1073741833, 1073741843 ) AND
els.log_id=el.log_id AND els.setting_name='reviewId' AND
ra.review_id=CAST(els.setting_value AS INTEGER)
</query><!-- SUBMISSION_LOG_REVIEW_ACCEPT, SUBMISSION_LOG_REVIEW_DECLINE, SUBMISSION_LOG_REVIEW_UNCONSIDERED, SUBMISSION_LOG_REVIEW_FILE -->
</sql>
</data>
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE version SYSTEM "../../lib/pkp/dtd/version.dtd">
<!--
* dbscripts/xml/version.xml
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* OJS version information.
-->
<version>
<application>ojs2</application>
<type>core</type>
<release>3.4.0.5</release>
<tag>3_4_0-5</tag>
<date>2024-02-23</date>
<info>https://pkp.sfu.ca/ojs/</info>
<package>https://pkp.sfu.ca/ojs/download/ojs-3.4.0-5.tar.gz</package>
</version>