Cannot db migrate from 2.1.2 to 2.4.1 nor 2.3.4
Added by Andrej Simko about 11 years ago
Both tries exit with:
CreateUserPreferences: migrating ========================================
-- create_table(:user_preferences)
rake aborted!
An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'user_preferences' already exists: CREATE TABLE `user_preferences` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11) DEFAULT 0 NOT NULL, `others` text) ENGINE=InnoDB/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `log'
/var/lib/gems/1.8/gems/activesupport-3.2.15/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:213:in `execute'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:170:in `create_table'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:434:in `create_table'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:466:in `send'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:466:in `method_missing'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:438:in `say_with_time'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:438:in `say_with_time'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:458:in `method_missing'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:334:in `send'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:334:in `method_missing'
/var/www/redmine-2.4.1/db/migrate/008_create_user_preferences.rb:3:in `up'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:370:in `up'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:410:in `send'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:410:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:410:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:389:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:528:in `__send__'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:528:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:720:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:777:in `call'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:777:in `ddl_transaction'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:719:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:700:in `each'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:700:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:570:in `up'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/migration.rb:551:in `migrate'
/var/lib/gems/1.8/gems/activerecord-3.2.15/lib/active_record/railties/databases.rake:193
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Any suggestion?
Thank you!
Replies (1)
RE: Cannot db migrate from 2.1.2 to 2.4.1 nor 2.3.4 - Added by Andrej Simko about 11 years ago
Also if I do this migrate, my users are gone! Only user admin is there.
I also try to upgrade to 2.1.6, same result...