Project

General

Profile

Actions

Defect #36753

closed

Mysql2::Error: Table 'email_addresses' already exists: CREATE TABLE `email_addresses` when update from 2.6.0 to 4.2.4

Added by Sam XIAO over 2 years ago. Updated over 2 years ago.

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

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

➜  redmine-4.2.4 rails  db:rollback RAILS_ENV=production
== 20200826153402 AddTotpToUser: reverting ====================================
-- remove_column(:users, :twofa_totp_last_used_at, :integer)
   -> 0.0613s
-- remove_column(:users, :twofa_totp_key, :string)
   -> 0.0377s
== 20200826153402 AddTotpToUser: reverted (0.1032s) ===========================

➜  redmine-4.2.4 mysql -uUszRm423 -ppWd22o31o#d@9866 redmine424_00  < wfims-bk220310.sql
zsh: no such file or directory: wfims-bk220310.sql
➜  redmine-4.2.4 cd ..
➜  ~ mysql -uUszRm423 -ppWd22o31o#d@9866 redmine424_00  < wfims-bk220310.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
➜  ~ cd redmine-4.2.4
➜  redmine-4.2.4
➜  redmine-4.2.4 rails  db:migrate RAILS_ENV=production
== 20141029181752 AddTrackersDefaultStatusId: migrating =======================
-- add_column(:trackers, :default_status_id, :integer, {})
   -> 0.0157s
== 20141029181752 AddTrackersDefaultStatusId: migrated (0.0420s) ==============

== 20141029181824 RemoveIssueStatusesIsDefault: migrating =====================
-- remove_column(:issue_statuses, :is_default)
   -> 0.0254s
== 20141029181824 RemoveIssueStatusesIsDefault: migrated (0.0255s) ============

== 20141109112308 AddRolesUsersVisibility: migrating ==========================
-- add_column(:roles, :users_visibility, :string, {:limit=>30, :default=>"all", :null=>false})
   -> 0.0109s
== 20141109112308 AddRolesUsersVisibility: migrated (0.0110s) =================

== 20141122124142 AddWikiRedirectsRedirectsToWikiId: migrating ================
-- add_column(:wiki_redirects, :redirects_to_wiki_id, :integer, {})
   -> 0.0107s
-- change_column(:wiki_redirects, :redirects_to_wiki_id, :integer, {:null=>false})
   -> 0.0204s
== 20141122124142 AddWikiRedirectsRedirectsToWikiId: migrated (0.0342s) =======

== 20150113194759 CreateEmailAddresses: migrating =============================
-- create_table(:email_addresses, {:options=>"ENGINE=InnoDB", :id=>:integer})
rails aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'email_addresses' already exists: CREATE TABLE `email_addresses` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `user_id` int NOT NULL, `address` varchar(255) NOT NULL, `is_default` tinyint(1) DEFAULT FALSE NOT NULL, `notify` tinyint(1) DEFAULT TRUE NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL) ENGINE=InnoDB
/home/samxiao/redmine-4.2.4/db/migrate/20150113194759_create_email_addresses.rb:3:in `change'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'email_addresses' already exists: CREATE TABLE `email_addresses` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `user_id` int NOT NULL, `address` varchar(255) NOT NULL, `is_default` tinyint(1) DEFAULT FALSE NOT NULL, `notify` tinyint(1) DEFAULT TRUE NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL) ENGINE=InnoDB
/home/samxiao/redmine-4.2.4/db/migrate/20150113194759_create_email_addresses.rb:3:in `change'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

Caused by:
Mysql2::Error: Table 'email_addresses' already exists
/home/samxiao/redmine-4.2.4/db/migrate/20150113194759_create_email_addresses.rb:3:in `change'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
➜  redmine-4.2.4  

Actions

Also available in: Atom PDF