-
Notifications
You must be signed in to change notification settings - Fork 13.9k
/
20110730000001_add_initial_indexes.rb
executable file
·85 lines (61 loc) · 1.86 KB
/
20110730000001_add_initial_indexes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
class AddInitialIndexes < ActiveRecord::Migration
def self.up
add_index :hosts, :address
add_index :hosts, :address6
add_index :hosts, :name
add_index :hosts, :state
add_index :hosts, :os_name
add_index :hosts, :os_flavor
add_index :hosts, :purpose
# Removed (conditionally dropped in the next migration)
# add_index :hosts, :comments
add_index :services, :port
add_index :services, :proto
add_index :services, :state
add_index :services, :name
# Removed (conditionally dropped in the next migration)
# add_index :services, :info
add_index :notes, :ntype
add_index :vulns, :name
# Removed (conditionally dropped in the next migration)
# add_index :vulns, :info
add_index :refs, :name
add_index :web_sites, :vhost
add_index :web_sites, :comments
add_index :web_sites, :options
add_index :web_pages, :path
add_index :web_pages, :query
add_index :web_forms, :path
add_index :web_vulns, :path
add_index :web_vulns, :method
add_index :web_vulns, :name
end
def self.down
remove_index :hosts, :address
remove_index :hosts, :address6
remove_index :hosts, :name
remove_index :hosts, :state
remove_index :hosts, :os_name
remove_index :hosts, :os_flavor
remove_index :hosts, :purpose
remove_index :hosts, :comments
remove_index :services, :port
remove_index :services, :proto
remove_index :services, :state
remove_index :services, :name
remove_index :services, :info
remove_index :notes, :ntype
remove_index :vulns, :name
remove_index :vulns, :info
remove_index :refs, :name
remove_index :web_sites, :vhost
remove_index :web_sites, :comments
remove_index :web_sites, :options
remove_index :web_pages, :path
remove_index :web_pages, :query
remove_index :web_forms, :path
remove_index :web_vulns, :path
remove_index :web_vulns, :method
remove_index :web_vulns, :name
end
end