Defect #4278
closedMysql::Error: Updated from 0.8.0 to trunk rev 3085
0%
Description
My updating steps carried out the system requirements (/wiki/redmine/RedmineUpgrade). However, the step 4 reported the following error
Step 1 ... ... OK.
Step 2 ... ... OK.
Step 3 ... ... OK.
Step 4:> RAILS_ENV=production rake db:migrate --trace
rake aborted! An error has occurred, all later migrations canceled: Mysql::Error: Table 'member_roles' already exists: CREATE TABLE `member_roles` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `member_id` int(11) NOT NULL, `role_id` int(11) NOT NULL) ENGINE=InnoDB /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract_adapter.rb:219:in `log' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:319:in `execute' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:114:in `create_table' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:472:in `create_table' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:352:in `send' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:352:in `method_missing' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:328:in `say_with_time' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:328:in `say_with_time' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:348:in `method_missing' ./db/migrate//20090503121501_create_member_roles.rb:3:in `up_without_benchmarks' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:282:in `send' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:282:in `migrate' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:282:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:365:in `__send__' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:365:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:486:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:562:in `call' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:562:in `ddl_transaction' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:485:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:472:in `each' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:472:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:400:in `up' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:383:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/tasks/databases.rake:116 /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /home/liwei/.gem/ruby/1.8/gems/rake-0.8.7/bin/rake:31 /usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19
Updated by Jean-Philippe Lang almost 15 years ago
- Status changed from New to Closed
- Resolution set to Invalid
The fact that this table was already present means that one of the migrations (CreateMemberRoles) has already been executed and the table deleted. Your database was not consistent with the migration information stored by rails.
I'm sorry but I can't fix your problem.
Updated by Cyber Sprocket over 14 years ago
If you had a failed upgrade/migration in the past you may need to rename the pre-existing member_roles and group_users tables. After a successful upgrade you can delete the member_roles_saved and groups_users_saved tables.
mysql> rename table member_roles to member_roles_saved
mysql> rename table groups_users to groups_users_saved