プロジェクト

全般

プロフィール

Vote #70272

完了

Upgrade Redmine 1.0.2 -> 1.2.0, PostgreSQL DB Migration issues

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Database_21
対象バージョン:
-
開始日:
2011/07/05
期日:
進捗率:

0%

予定工数:
category_id:
21
version_id:
0
issue_org_id:
8747
author_id:
36241
assigned_to_id:
0
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
27
ステータス-->[Closed]

説明

Ruby Version: 1.8.7
PostgreSQL Version: 8.4.5
Rails Version: 2.3.11
Redmine Version: 1.2.0

Two scripts block the upgrade from Redmine 1.0.2 to 1.2.0 when using PostgreSQL database. Both JDBC and native database connectors are affected. I think this happens cause PostgreSQL is more strict than MySQL.

The issue happens, cause the migration scripts set newly created table columns to be "not null" before assigning a default value to all existing entries. As I do not know Ruby I can't submit a patch for them, but I hope I'm able to report the issue as good as possible.

  • db/migrate/20110220160626_add_workflows_assignee_and_author.rb @ add_column :workflows, :assignee, :boolean, :null => false, :default => false add_column :workflows, :author, :boolean, :null => false, :default => false Workflow.update_all("assignee = #{Workflow.connection.quoted_false}") Workflow.update_all("author = #{Workflow.connection.quoted_false}")@

here the values are set with "update_all" but the script fails at the first add_column. I've removed the @:null=>false@ and afterwards I set the "not null" on database level.

  • db/migrate/20110412065600_add_issues_is_private.rb: @ add_column :issues, :is_private, :boolean, :default => false, :null => false @

here no "update" is done, so I performed an "UPDATE issues SET is_private=DEFAULT WHERE is_default is null" on database level and also set the "not null" afterwards.

I think both scripts should be fixed to first change the schema, then update all fields and last set not null on the columns. I hope this helps someone


journals

Notas1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I'm closing this ticket because is very old and almost sure obsolete. Please reopen if you experience the same issue on the latest Redmine versions.
--------------------------------------------------------------------------------

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0