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

Collapse All | Expand All

(-)a/dbscripts/xml/upgrade/2.3.5_update.xml (+34 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 there is a duped
25
	  -    editor decision entry. (See bug #6428.) Duplicate entries help
26
	  -    us to identify submissions that were created via the QuickSubmit
27
	  -    or Expedited Submission processes (i.e. the two cases where
28
	  -    publication dates will be incorrect).
29
	  -->
30
	<sql>
31
		<query driver="mysql">UPDATE published_articles pa, edit_decisions e1, edit_decisions e2, articles a SET pa.date_published = NULL WHERE pa.article_id = a.article_id AND e1.article_id = a.article_id AND e2.article_id = a.article_id AND e1.edit_decision_id <> e2.edit_decision_id AND e1.date_decided = e2.date_decided AND pa.date_published >= a.date_submitted</query>
32
		<query driver="postgres7">UPDATE published_articles SET date_published = NULL WHERE article_id IN (SELECT DISTINCT a.article_id FROM articles a, published_articles pa, edit_decisions e1, edit_decisions e2 WHERE pa.article_id = a.article_id AND e1.article_id = a.article_id AND e2.article_id = a.article_id AND e1.edit_decision_id <> e2.edit_decision_id AND e1.date_decided = e2.date_decided AND pa.date_published >= a.date_submitted)</query>
33
	</sql>
34
</data>

Return to bug 6451