Sha256: e2854cbd527e006c0ff0e9b1c1f65ad7e81e24d126957981f385b5d981eb273f

Contents?: true

Size: 1.63 KB

Versions: 22

Compression:

Stored size: 1.63 KB

Contents

class CreateTables < ActiveRecord::Migration[4.2]

	def self.up
		
		create_table :hosts do |t|
			t.timestamp :created
			t.string    :address, :limit => 16 # unique
			t.string    :address6
			t.string    :mac
			t.string    :comm
			t.string    :name
			t.string    :state
			t.string    :info, :limit => 1024
			t.string    :os_name
			t.string    :os_flavor
			t.string    :os_sp
			t.string    :os_lang
			t.string    :arch
		end
		
		add_index :hosts, :address, :unique => true
		
		create_table :clients do |t|
			t.integer   :host_id
			t.timestamp :created
			t.string    :ua_string, :limit => 1024, :null => false
			t.string    :ua_name, :limit => 64
			t.string    :ua_ver, :limit => 32
		end
		
		create_table :services do |t|
			t.integer   :host_id
			t.timestamp :created
			t.integer   :port, :null => false
			t.string    :proto, :limit => 16, :null => false
			t.string    :state
			t.string    :name
			t.string    :info, :limit => 1024
		end
		
		create_table :vulns do |t|
			t.integer   :host_id
			t.integer   :service_id
			t.timestamp :created
			t.string    :name
			t.text      :data
		end
		
		create_table :refs do |t|
			t.integer   :ref_id
			t.timestamp :created
			t.string    :name, :limit => 512
		end
		
		create_table :vulns_refs, :id => false do |t|
			t.integer   :ref_id
			t.integer   :vuln_id
		end
		
		create_table :notes do |t|
			t.integer   :host_id
			t.timestamp :created
			t.string    :ntype, :limit => 512
			t.text      :data
		end
		
	end
	
	def self.down
		drop_table :hosts
		drop_table :clients
		drop_table :services
		drop_table :vulns
		drop_table :refs
		drop_table :vulns_refs
		drop_table :notes
	end

end

Version data entries

22 entries across 22 versions & 2 rubygems

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