"bundle exec rake db:migrate RAILS_ENV=production" error
Added by Eric Göltzer almost 10 years ago
Hello!
I try to upgrade my redmine installation on an Ubuntu 14.04. I checked out the master with git. After this i ran "bundle exec rake db:migrate RAILS_ENV=production" like it is described here. Then I got the following error:
-- create_table(:email_addresses)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::DuplicateTable: ERROR: relation "email_addresses" already exists
: CREATE TABLE "email_addresses" ("id" serial primary key, "user_id" integer NOT NULL, "address" character varying NOT NULL, "is_default" boolean DEFAULT 'f' NOT NULL, "notify" boolean DEFAULT 't' NOT NULL, "created_on" timestamp NOT NULL, "updated_on" timestamp NOT NULL) /var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `block in log'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:460:in `log'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in `execute'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:206:in `create_table'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:662:in `block in method_missing'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `block in say_with_time'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `say_with_time'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:652:in `method_missing'
/usr/share/redmine/db/migrate/20150113194759_create_email_addresses.rb:3:in `change'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:606:in `exec_migration'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:589:in `block in migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:588:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:765:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/transactions.rb:220:in `transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:1041:in `ddl_transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:956:in `block in migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `each'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:820:in `up'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/migration.rb:798:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
Did I anything wrong? Please help me to find out my failure!
Thanks!
Eric