Sha256: 0042f9a805176f9f60bde7a7e7c842f5262b3303aeffdd8c33e062ffefb9d587

Contents?: true

Size: 335 Bytes

Versions: 42

Compression:

Stored size: 335 Bytes

Contents

class AddUniqueToInsightsRules < ActiveRecord::Migration[5.2]
  def change
    begin
      # remove old index
      remove_index :insights_rules, [:rule_id]
    rescue ArgumentError
      # noop, if the index is not there, it's OK.
    end

    # add unique constraint
    add_index :insights_rules, [:rule_id], unique: true
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
foreman_rh_cloud-11.0.3 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.59 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-11.0.2 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-11.0.1 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-11.0.0 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.58 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-10.0.2 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.57 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-10.0.1 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.56 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.55 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.54 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.53 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.52 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-8.0.52 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-9.0.51 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-8.0.51 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-7.0.48 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-7.0.47 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-8.0.50 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb