<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">

<!--
  * 2.4.0_idupdate_articles.xml
  *
  * Copyright (c) 2013-2016 Simon Fraser University Library
  * Copyright (c) 2003-2016 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * 2.4.0 id update pre-migration script, run prior to schema sync.
  *
  -->

<data>
	<!-- Prepare migration of public ids and DOIs to settings tables -->
	<sql>
		<query>INSERT INTO article_settings (article_id, setting_name, setting_value, setting_type, locale) SELECT article_id, 'pub-id::doi', doi, 'string', '' FROM articles WHERE doi IS NOT NULL AND doi != ''</query>

		<query driver="postgres7">
			DROP INDEX articles_user_id
		</query>
		<query driver="postgres7">
			DROP INDEX articles_journal_id
		</query>
		<query driver="postgres7">
			DROP INDEX articles_section_id
		</query>
	</sql>
</data>
