Actions
Defect #9800
closedMigration error rake db:migrate RAILS_ENV="production"
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
I just updated trunk code.
when I run the command in a clean db.
rake db:migrate RAILS_ENV="production"
I get the following error
== AddRolePosition: migrating ================================================ -- add_column(:roles, :position, :integer, {:default=>1}) -> 0.3130s rake aborted! An error has occurred, all later migrations canceled: Mysql::Error: You can't specify target table 'roles' for update in FROM clause: UPDATE `roles` SET position = (SELECT COUNT(*) FROM roles r WHERE r.id < id) + 1 Tasks: TOP => db:migrate
Env info
About your application's environment Ruby version 1.8.7 (i486-linux) RubyGems version 1.3.7 Rack version 1.1.2 Rails version 2.3.14 Active Record version 2.3.14 Active Resource version 2.3.14 Action Mailer version 2.3.14 Active Support version 2.3.14 Application root /var/www/redmine Environment production Database adapter mysql Database schema version 19
thanks
Updated by leonardo lazzaro over 13 years ago
Please see a similar error here : http://www.redmine.org/boards/2/topics/27969?r=27994
Updated by Jean-Philippe Lang over 13 years ago
- Status changed from New to Closed
- Resolution set to Fixed
Fixed in r8213. You'll have to recreate your database.
Actions