Project

General

Profile

Actions

Defect #14029

closed

db migration issue from 1.4 to redmine-2.2.4

Added by simo geo over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Hi, I have an issue with DB when upgrading redmine from 1.4 to redmine-2.2.4, running the following command :

sudo RAILS_ENV=production rake db:migrate 

I get the following error regarding comments table :

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
==  CreateComments: migrating =================================================
-- create_table(:comments)
rake aborted!
An error has occurred, all later migrations canceled:

Mysql::Error: Table 'comments' already exists: CREATE TABLE `comments` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `commented_type` varchar(30) DEFAULT '' NOT NULL, `commented_id` int(11) DEFAULT 0 NOT NULL, `author_id` int(11) DEFAULT 0 NOT NULL, `comments` text, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL) ENGINE=InnoDB/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `log'
/var/lib/gems/1.8/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:170:in `create_table'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:434:in `create_table'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:466:in `send'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:466:in `method_missing'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `say_with_time'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `say_with_time'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:458:in `method_missing'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:334:in `send'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:334:in `method_missing'
/usr/local/share/redmine-2.2.4/db/migrate/010_create_comments.rb:3:in `up'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:370:in `up'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:410:in `send'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:410:in `migrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:410:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:389:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:528:in `__send__'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:528:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:720:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:in `call'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:in `ddl_transaction'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:719:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `each'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:570:in `up'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/migration.rb:551:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:193
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:73:in `run'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/var/lib/gems/1.8/gems/rake-10.0.4/bin/rake:33
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
Tasks: TOP => db:migrate

Actions #1

Updated by Jean-Baptiste Barth over 11 years ago

This migration shouldn't run, I suspect your schema_migrations table is broken. Can you try to see if it's present and its content ?

Actions #2

Updated by simo geo over 11 years ago

Hi Jean-Baptiste,

The schema_migrations table was there. Actually, I just did again the mysql dump/import and it finally worked.

Thanks for your help, you put me on the right direction.

Bye, simo

Actions #3

Updated by Jean-Baptiste Barth over 11 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Great! I close the issue then.

Actions

Also available in: Atom PDF