Skip to content

Commit

Permalink
*8338* Fix upgrade process via 2.4.0 (OJS master port)
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jul 26, 2013
1 parent d9e7b0a commit 29ab3ec
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 111 deletions.
7 changes: 1 addition & 6 deletions dbscripts/xml/upgrade.xml
Expand Up @@ -156,12 +156,7 @@
<code function="installEmailTemplate" key="REVIEW_REQUEST_SUBSEQUENT" locales="en_US,de_DE,eu_ES,it_IT,nl_NL,pt_BR,tr_TR,uk_UA,zh_CN" />

<!-- ID upgrade -->
<data file="dbscripts/xml/upgrade/2.4.0_idupgrade_issues2.xml" condition="return $installer->tableExists('issues_old');" />
<data file="dbscripts/xml/upgrade/2.4.0_idupgrade_articles2.xml" condition="return $installer->tableExists('articles_old');" />
<data file="dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles2.xml" condition="return $installer->tableExists('published_articles_old');" />
<data file="dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys2.xml" condition="return $installer->tableExists('issue_galleys_old');" />
<data file="dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys2.xml" condition="return $installer->tableExists('article_galleys_old');" />
<data file="dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files2.xml" condition="return $installer->tableExists('article_supp_files_old');" />
<data file="dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys2.xml" condition="return $installer->tableExists('tmp_public_galley_ids');" />

<!-- Mutex helper table. -->
<data file="lib/pkp/xml/mutexData.xml" />
Expand Down
2 changes: 1 addition & 1 deletion dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys.xml
Expand Up @@ -14,7 +14,7 @@
<data>
<!-- Prepare migration of public ids and DOIs to settings tables -->
<sql>
<rename table="article_galleys" to="article_galleys_old" />
<query>CREATE TABLE tmp_public_galley_ids AS SELECT galley_id, public_galley_id FROM article_galleys</query>

<query driver="postgres7">
DROP INDEX article_galleys_article_id
Expand Down
6 changes: 2 additions & 4 deletions dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys2.xml
Expand Up @@ -16,9 +16,7 @@
<!--
- Migrate public IDs to settings tables.
-->
<query>INSERT INTO article_galleys (galley_id, locale, article_id, file_id, label, html_galley, style_file_id, seq) SELECT galley_id, locale, article_id, file_id, label, html_galley, style_file_id, seq FROM article_galleys_old</query>
<query driver="postgres7">SELECT SETVAL(pg_get_serial_sequence('article_galleys', 'galley_id'), (SELECT MAX(galley_id) FROM article_galleys)+1)</query>
<query>INSERT INTO article_galley_settings (galley_id, setting_name, setting_value, setting_type, locale) SELECT galley_id, 'pub-id::publisher-id', public_galley_id, 'string', '' FROM article_galleys_old</query>
<query>DROP TABLE article_galleys_old</query>
<query>INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type, locale) SELECT galley_id, 'pub-id::publisher-id', public_galley_id, 'string', '' FROM tmp_public_galley_ids</query>
<query>DROP TABLE tmp_public_galley_ids</query>
</sql>
</data>
2 changes: 1 addition & 1 deletion dbscripts/xml/upgrade/2.4.0_idupgrade_articles.xml
Expand Up @@ -14,7 +14,7 @@
<data>
<!-- Prepare migration of public ids and DOIs to settings tables -->
<sql>
<rename table="articles" to="articles_old" />
<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
Expand Down
24 changes: 0 additions & 24 deletions dbscripts/xml/upgrade/2.4.0_idupgrade_articles2.xml

This file was deleted.

2 changes: 1 addition & 1 deletion dbscripts/xml/upgrade/2.4.0_idupgrade_issues.xml
Expand Up @@ -14,7 +14,7 @@
<data>
<!-- Prepare migration of public ids and DOIs to settings tables -->
<sql>
<rename table="issues" to="issues_old" />
<query>INSERT INTO issue_settings (issue_id, setting_name, setting_value, setting_type, locale) SELECT issue_id, 'pub-id::publisher-id', public_issue_id, 'string', '' FROM issues WHERE public_issue_id IS NOT NULL AND public_issue_id != ''</query>

<query driver="postgres7">
DROP INDEX issues_journal_id
Expand Down
24 changes: 0 additions & 24 deletions dbscripts/xml/upgrade/2.4.0_idupgrade_issues2.xml

This file was deleted.

3 changes: 2 additions & 1 deletion dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles.xml
Expand Up @@ -14,7 +14,8 @@
<data>
<!-- Prepare migration of public ids and DOIs to settings tables -->
<sql>
<rename table="published_articles" to="published_articles_old" />
<query>INSERT INTO article_settings (article_id, setting_name, setting_value, setting_type, locale) SELECT article_id, 'pub-id::publisher-id', public_article_id, 'string', '' FROM published_articles</query>
<rename table="published_articles" column="pub_id" to="published_article_id" />

<query driver="postgres7">
DROP INDEX published_articles_article_id
Expand Down
24 changes: 0 additions & 24 deletions dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles2.xml

This file was deleted.

2 changes: 1 addition & 1 deletion dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files.xml
Expand Up @@ -14,7 +14,7 @@
<data>
<!-- Prepare migration of public ids and DOIs to settings tables -->
<sql>
<rename table="article_supplementary_files" to="article_supp_files_old" />
<query>INSERT INTO article_supp_file_settings (supp_id, setting_name, setting_value, setting_type, locale) SELECT supp_id, 'pub-id::publisher-id', public_supp_file_id, 'string', '' FROM article_supplementary_files</query>

<query driver="postgres7">
DROP INDEX article_supplementary_files_file_id
Expand Down
24 changes: 0 additions & 24 deletions dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files2.xml

This file was deleted.

0 comments on commit 29ab3ec

Please sign in to comment.