Sha256: ed704f4557d9401213a2bac4bdd4139543fcd67530d76fc034beee6d0cc1fc9e
Contents?: true
Size: 363 Bytes
Versions: 84
Compression:
Stored size: 363 Bytes
Contents
class AddUniqueToInsightsFacet < ActiveRecord::Migration[5.2] def change # Remove duplicate records InsightsFacet.where.not(id: InsightsFacet.select('max(id)').group(:host_id)).delete_all # remove old index remove_index :insights_facets, [:host_id] # add unique constraint add_index :insights_facets, [:host_id], unique: true end end
Version data entries
84 entries across 84 versions & 1 rubygems