プロジェクト

全般

プロフィール

Vote #64620

完了

db:migrate does not take into account custom table prefix

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

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

0%

予定工数:
category_id:
21
version_id:
7
issue_org_id:
2699
author_id:
3878
assigned_to_id:
0
comments:
2
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

I need to have a table prefix for redmine, so I have put this in the environment.db file:
config.active_record.table_name_prefix = 'rm_'

When I do "rake db:migrate" to initialize redmine, it fails at: SetTopicAuthorsAsWatchers with following message:

==  SetTopicAuthorsAsWatchers: migrating ======================================
rake aborted!
An error has occurred, all later migrations canceled:

Mysql::Error: Table 'my_scheme.watchers' doesn't exist: INSERT INTO watchers (watchable_type, watchable_id, user_id) SELECT DISTINCT 'Message', COALESCE(messages.parent_id, messages.id), messages.author_id FROM messages, users WHERE messages.author_id = users.id AND users.status = 1

Very quick fix is to put the prefix into the INSERT statement. For example, I have prefix rm_ so I change it to:

INSERT INTO rm_watchers ..... FROM rm_messages messages, rm_users users....

I have no time now to find proper solution, I am just writing it here to let you know, that this issue exists.


journals

This is fixed in r2415. Thanks.
--------------------------------------------------------------------------------
Merged in 0.8 branch in r2425.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリDatabase_21 にセット
  • 対象バージョン0.8.1_7 にセット

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

いいね!0
いいね!0