Sha256: c85a4ceaef080cb5990e508dc6b40f34b250be7ca9825543fb0aff2fe47e420e

Contents?: true

Size: 574 Bytes

Versions: 22

Compression:

Stored size: 574 Bytes

Contents

class RenameAndPruneNessusVulns < ActiveRecord::Migration[4.2]

	class Vuln < ApplicationRecord
	end

	# No table changes, just vuln renaming to drop the NSS id
	# from those vulns that have it and a descriptive name.
	def self.up
		Vuln.all.each do |v|
			if v.name =~ /^NSS-0?\s*$/
				v.delete
				next
			end
			next unless(v.name =~ /^NSS-[0-9]+\s(.+)/)
			new_name = $1
			next if(new_name.nil? || new_name.strip.empty?)
			v.name = new_name
			v.save!
		end
	end

	def self.down
		say "Cannot un-rename and un-prune NSS vulns for migration 20110517160800."
	end

end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
wg-metasploit_data_models-4.1.4.02 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-6.0.5 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-6.0.4 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-6.0.3 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-6.0.2 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-6.0.1 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-6.0.0 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-5.0.6 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-5.0.5 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-5.0.4 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-5.0.3 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-5.0.2 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-5.0.1 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-5.0.0 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-4.1.4 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-4.1.3 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-4.1.2 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-4.1.1 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-4.1.0 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb
metasploit_data_models-4.0.2 db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb