Vote #64620
完了db:migrate does not take into account custom table prefix
0%
説明
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.
--------------------------------------------------------------------------------