Content
Error migration to openproject 3
Added by Daniel Quisbert over 10 years ago
LegacyWikiContentJournalData: migrating =
— add_index(“wiki_content_journals”, [“journal_id”])
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Index name ‘index_wiki_content_journals_on_journal_id’ on table ‘wiki_content_journals’ already exists/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/schema_statements.rb:576:in `add_index_options’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/schema_statements.rb:351:in `add_index’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:466:in `block in method_missing’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:438:in `block in say_with_time’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:438:in `say_with_time’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:458:in `method_missing’
/var/www/openproject/db/migrate/20130920093823_legacy_wiki_content_journal_data.rb:37:in `up’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:410:in `block (2 levels) in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:410:in `block in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:389:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:528:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:720:in `block (2 levels) in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:777:in `call’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:777:in `ddl_transaction’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:719:in `block in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:700:in `each’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:700:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:570:in `up’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:551:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/railties/databases.rake:193:in `block (2 levels) in <top (required)>’
/home/openproject/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval’
/home/openproject/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `
’
ArgumentError: Index name ‘index_wiki_content_journals_on_journal_id’ on table ‘wiki_content_journals’ already exists
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/schema_statements.rb:576:in `add_index_options’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/schema_statements.rb:351:in `add_index’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:466:in `block in method_missing’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:438:in `block in say_with_time’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:438:in `say_with_time’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:458:in `method_missing’
/var/www/openproject/db/migrate/20130920093823_legacy_wiki_content_journal_data.rb:37:in `up’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:410:in `block (2 levels) in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:410:in `block in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:389:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:528:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:720:in `block (2 levels) in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:777:in `call’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:777:in `ddl_transaction’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:719:in `block in migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:700:in `each’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:700:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:570:in `up’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/migration.rb:551:in `migrate’
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.19/lib/active_record/railties/databases.rake:193:in `block (2 levels) in <top (required)>’
/home/openproject/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval’
/home/openproject/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `
’
Tasks: TOP => db:migrate
(See full trace by running task with —trace)
What is the solution?
thanks! :D
Replies (2)
Hello Daniel,
it looks like the migration runs the second time maybe there was a different error before?
Did you made a database backup before you started the migration? If yes than you should apply this backup and run the migrations again.
If NO, you can comment out the following line in the migration file and start the migrations again:
Go to the OpenProject root folder and open this file:
db/migrate/20130920093823_legacy_wiki_content_journal_data.rb
Than add a
#
in the front of line 37 that the ‘up’ method looks like this:Save and close the file and run the migrations again.
Best
Ratzi
Thanks Christian Ratz,
your answer helped me solve the problem. :-)