Class: Kekkan::Base::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/kekkan/base/schema.rb

Overview

Kekkan database Schema

Class Method Summary collapse

Class Method Details

.downObject

Deletes all of the database tables created



91
92
93
94
95
96
97
98
99
100
# File 'lib/kekkan/base/schema.rb', line 91

def self.down
	drop_table :entries
	#drop_table :vulnerable_configurations
	drop_table :vulnerable_software_lists
	drop_table :cvsses
	drop_table :references
	drop_table :assessment_checks
	drop_table :scanners
	drop_table :versions
end

.upObject

Creates all of the database tables required by the parser



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/kekkan/base/schema.rb', line 29

def self.up
	create_table :entries do |t|
		t.string :cve
		t.string :published_datetime
		t.string :last_modified_datetime
		t.string :summary
		t.string :cwe
		t.string :security_protection
	end

	#create_table :vulnerable_configurations do |t|
		#ignoring for now
	#end

	create_table :vulnerable_software_lists do |t|
		t.integer :entry_id
		t.string :product
	end

	create_table :cvsses do |t|
		t.integer :entry_id
		t.string :score
		t.string :access_vector
		t.string :access_complexity
		t.string :authenication
		t.string :confidentiality_impact
		t.string :integrity_impact
		t.string :availability_impact
		t.string :source
		t.string :generated_on_datetime
	end

	create_table :references do |t|
		t.integer :entry_id
		t.string :source
		t.string :ref_type
		t.string :reference
		t.string :href
		t.string :language
	end

	create_table :assessment_checks do |t|
		t.integer :entry_id
		t.string :name
		t.string :href
		t.string :system
	end

	create_table :scanners do |t|
		t.integer :entry_id
		t.string :name
		t.string :href
		t.string :system
	end

	create_table :versions do |t|
		t.string :version
	end
end