KUNTUL | JINGKONTOT
JINGKONTOT


Server : Apache/2.4.41 (Ubuntu)
System : Linux journalup 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/dbscripts/xml/upgrade/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml
<?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-2020 Simon Fraser University
 * Copyright (c) 2003-2020 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 STATUS_PUBLISHED that are missing a corresponding entry
		in the published_submissions table and reset them to 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 STATUS_PUBLISHED. A submission should never
		have 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" />
		<dropindex table="citations" index="citations_submission_seq" />
		<rename table="citations" column="submission_id" to="publication_id" />
	</sql>
</data>

KUNTUL | JINGKONTOT |