We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

View | Details | Raw Unified | Return to bug 6451 | Differences between
and this patch

Collapse All | Expand All

(-)ojs-2.3.4-stock/dbscripts/xml/upgrade/2.3.5_update.xml (+33 lines)
Line 0    Link Here 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
3
4
<!--
5
  * 2.3.5_update.xml
6
  *
7
  * Copyright (c) 2003-2011 John Willinsky
8
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9
  *
10
  * 2.3.5 database updates XML file.
11
  -->
12
<data>
13
	<!-- Bug #6451: Check and purge incorrect publication date data -->
14
	<!--
15
	  - 1. Drop the NOT NULL constraint on pa.date_published. This is not
16
	  -    reliably done by ADODB.
17
	  -->
18
	<sql>
19
		<query driver="mysql">ALTER TABLE published_articles CHANGE COLUMN date_published date_published DATETIME</query>
20
		<query driver="postgres7">ALTER TABLE published_articles ALTER COLUMN date_published DROP NOT NULL</query>
21
	</sql>
22
23
	<!--
24
	  - 2. Null out pa.date_published from entries where the date published
25
	  -    is less than 5 minutes after the date submitted. (Likely to
26
	  -    indicate a batch process such as expedited submission or quick
27
	  -    submit.)
28
	  -->
29
	<sql>
30
		<query driver="mysql">UPDATE published_articles pa, articles a SET pa.date_published = NULL WHERE a.article_id = pa.article_id AND UNIX_TIMESTAMP(pa.date_published) - UNIX_TIMESTAMP(a.date_submitted) &lt; 300 AND UNIX_TIMESTAMP(pa.date_published) - UNIX_TIMESTAMP(a.date_submitted) &gt;= 0</query>
31
		<query driver="postgres7">UPDATE published_articles SET date_published = NULL WHERE article_id IN (SELECT a.article_id FROM published_articles pa, articles a WHERE a.article_id = pa.article_id AND EXTRACT(EPOCH FROM pa.date_published) - EXTRACT(EPOCH FROM a.date_submitted) &lt; 300 AND EXTRACT(EPOCH FROM pa.date_published) - EXTRACT(EPOCH FROM a.date_submitted) &gt;= 0)</query>
32
	</sql>
33
</data>
(-)ojs-2.3.4-stock/dbscripts/xml/upgrade.xml (+4 lines)
 Lines 253-258    Link Here 
253
		<data file="plugins/generic/counter/counter_monthly_log_1_1.xml" />
253
		<data file="plugins/generic/counter/counter_monthly_log_1_1.xml" />
254
	</upgrade>
254
	</upgrade>
255
255
256
	<upgrade minversion="2.0.0.0" maxversion="2.3.4.9">
257
		<data file="dbscripts/xml/upgrade/2.3.5_update.xml" />
258
	</upgrade>
259
256
	<!-- update plugin configuration - should be done as the final upgrade task -->
260
	<!-- update plugin configuration - should be done as the final upgrade task -->
257
	<code function="addPluginVersions" />
261
	<code function="addPluginVersions" />
258
</install>
262
</install>

Return to bug 6451