Sha256: 84acc2b648e48dff7bc5762202dba5f561868a73673c22ac9b38ad674ad07d93
Contents?: true
Size: 453 Bytes
Versions: 22
Compression:
Stored size: 453 Bytes
Contents
class RemoveDuplicateServices2 < ActiveRecord::Migration[4.2] def change select_mgr = Mdm::Service.arel_table.project( Mdm::Service[:host_id], Mdm::Service[:proto], Mdm::Service[:port].count ).group( 'host_id', 'port', 'proto' ).having(Mdm::Service[:port].count.gt(1)) Mdm::Service.find_by_sql(select_mgr).each(&:destroy) add_index :services, [:host_id, :port, :proto], unique: true end end
Version data entries
22 entries across 22 versions & 2 rubygems
Version | Path |
---|---|
metasploit_data_models-4.0.1 | db/migrate/20150212214222_remove_duplicate_services2.rb |
metasploit_data_models-4.0.0 | db/migrate/20150212214222_remove_duplicate_services2.rb |