Sha256: e91e6335595f88967b4b561cb8ed9c2171b615982193c47a26513c1c417e1bf0
Contents?: true
Size: 442 Bytes
Versions: 41
Compression:
Stored size: 442 Bytes
Contents
# frozen_string_literal: true class AddUniqueFeatureLabelIndex < ActiveRecord::Migration[6.0] def change remove_index :remote_execution_features, :label counts = RemoteExecutionFeature.group(:label).count counts.select { |_, count| count > 1 }.each do |label, count| RemoteExecutionFeature.where(label: label).limit(count - 1).delete_all end add_index :remote_execution_features, :label, unique: true end end
Version data entries
41 entries across 41 versions & 1 rubygems