Defect #5335

Error on db:migrate with table prefix set (hardcoded name in principal.rb)

Added by Michael Eberlein over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:2010-04-16
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Database
Target version:0.9.4
Resolution:Fixed Affected version:0.9.3

Description

Principal.rb has hardcoded table name on first line (set_table_name 'users'). This error prevents the use of table_name_prefix (config.active_record.table_name_prefix).

Error:
AddUserPreferencesTimeZone: migrating ===================================
-- add_column(:user_preferences, :time_zone, :string)
-> 0.0041s
AddUserPreferencesTimeZone: migrated (0.0042s) ==========================

AddUsersType: migrating =================================================
-- add_column(:users, :type, :string)
-> 0.0048s
rake aborted!
An error has occurred, all later migrations canceled:

Mysql::Error: Table 'redmine.users' doesn't exist: SHOW FIELDS FROM `users`

Application's environment:
Ruby version 1.8.7 (i686-linux)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.5
Active Record version 2.3.5
Active Resource version 2.3.5
Action Mailer version 2.3.5
Active Support version 2.3.5
Edge Rails revision unknown
Application root /var/lib/redmine
Environment production
Database adapter mysql
Database schema version 0

Associated revisions

Revision 3678
Added by Jean-Philippe Lang over 7 years ago

Fixed: Error on db:migrate with table prefix set (#5335).

History

#1 Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from New to Resolved
  • Target version set to 0.9.4
  • Resolution set to Fixed

Fixed in r3678.

#2 Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF