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-5.0.37 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb
foreman_rh_cloud-5.0.36 db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb