Actions
Bug #8366
closedUpgrade from 1.6.2 to 1.7rc1 fails during AddUniqueIndexToParameter db migration with duplicate key error
Description
Upgrading our Foreman instance from 1.6.2 to 1.7rc1 fails during migration of the DB with the following error:
== AddUniqueIndexToParameter: migrating ====================================== -- add_index(:parameters, [:reference_id, :name], {:unique=>true}) rake aborted! StandardError: An error has occurred, all later migrations canceled: Mysql2::Error: Duplicate entry '4-lag-members' for key 'index_parameters_on_reference_id_and_name': CREATE UNIQUE INDEX `index_parameters_on_reference_id_and_name` ON `parameters` (`reference_id`, `name`)/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.20/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query' (etc...)
This is caused by 20140805114754_add_unique_index_to_parameter.rb
trying to add the mentioned index. However, in my db, I have:
id name ref_id type 1 lag-members 4 GroupParameter 3 lag-members 4 HostParameter
Which leads to the SQL violation.
So it looks like anyone upgrading who has the same parameter set on both Group and Host might suffer this problem?
Actions