metasploit_data_models 0.14.1-java → 0.14.2-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ class MakingVulnsRefsARealArModel < ActiveRecord::Migration
2
+ def change
3
+ add_column :vulns_refs, :id, :primary_key
4
+ end
5
+ end
@@ -4,5 +4,5 @@ module MetasploitDataModels
4
4
  # metasploit-framework/data/sql/migrate to db/migrate in this project, not all models have specs that verify the
5
5
  # migrations (with have_db_column and have_db_index) and certain models may not be shared between metasploit-framework
6
6
  # and pro, so models may be removed in the future. Because of the unstable API the version should remain below 1.0.0
7
- VERSION = '0.14.1'
7
+ VERSION = '0.14.2'
8
8
  end
@@ -10,4 +10,13 @@ describe Mdm::VulnRef do
10
10
  it { should be_valid }
11
11
  end
12
12
  end
13
+
14
+ context 'database' do
15
+ context 'columns' do
16
+ it { should have_db_column(:id).of_type(:integer) }
17
+ it { should have_db_column(:ref_id).of_type(:integer) }
18
+ it { should have_db_column(:vuln_id).of_type(:integer) }
19
+ end
20
+ end
21
+
13
22
  end
@@ -38,7 +38,13 @@ describe Mdm::Vuln do
38
38
  FactoryGirl.create(:mdm_vuln_ref, :ref => ref, :vuln => vuln)
39
39
  }
40
40
  end
41
-
41
+
42
+ it 'should be deletable' do
43
+ expect {
44
+ vuln.destroy
45
+ }.not_to raise_error
46
+ end
47
+
42
48
  context 'with Mdm::Module::Detail' do
43
49
  let!(:module_detail) do
44
50
  FactoryGirl.create(
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130515172727) do
14
+ ActiveRecord::Schema.define(:version => 20130516204810) do
15
15
 
16
16
  create_table "api_keys", :force => true do |t|
17
17
  t.text "token"
@@ -511,7 +511,7 @@ ActiveRecord::Schema.define(:version => 20130515172727) do
511
511
 
512
512
  add_index "vulns", ["name"], :name => "index_vulns_on_name"
513
513
 
514
- create_table "vulns_refs", :id => false, :force => true do |t|
514
+ create_table "vulns_refs", :force => true do |t|
515
515
  t.integer "ref_id"
516
516
  t.integer "vuln_id"
517
517
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.14.1
5
+ version: 0.14.2
6
6
  platform: java
7
7
  authors:
8
8
  - Samuel Huckins
@@ -324,6 +324,7 @@ files:
324
324
  - db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
325
325
  - db/migrate/20130515164311_change_web_vulns_confidence_to_integer.rb
326
326
  - db/migrate/20130515172727_valid_mdm_web_vuln_params.rb
327
+ - db/migrate/20130516204810_making_vulns_refs_a_real_ar_model.rb
327
328
  - lib/mdm.rb
328
329
  - lib/mdm/host/operating_system_normalization.rb
329
330
  - lib/mdm/module.rb