Sha256: f33cf5afae6a876a5dcc1fd380120ff8e58974d05efcd7b86d5571175d6f275c

Contents?: true

Size: 840 Bytes

Versions: 5

Compression:

Stored size: 840 Bytes

Contents

# Changes all the {COLUMNS} in the web_vulns table that are required for {Mdm::WebVuln}, but were previously
# :null => true
class ChangeRequiredColumnsToNullFalseInWebVulns < ActiveRecord::Migration
  # Columns that were previously :null => true, but are actually required to be non-null, so should be
  # :null => false
  COLUMNS = [
      :category,
      :confidence,
      :method,
      :name,
      :params,
      :path,
      :pname,
      :proof,
      :risk
  ]
  # Table in which {COLUMNS} are.
  TABLE_NAME = :web_vulns

  # Marks all the {COLUMNS} as :null => true
  def down
    COLUMNS.each do |column|
      change_column_null(TABLE_NAME, column, true)
    end
  end

  # Marks all the {COLUMNS} as :null => false
  def up
    COLUMNS.each do |column|
      change_column_null(TABLE_NAME, column, false)
    end
  end


end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metasploit_data_models-0.7.0 db/migrate/20130228214900_change_required_columns_to_null_false_in_web_vulns.rb
metasploit_data_models-0.7.0-java db/migrate/20130228214900_change_required_columns_to_null_false_in_web_vulns.rb
metasploit_data_models-0.6.16 db/migrate/20130228214900_change_required_columns_to_null_false_in_web_vulns.rb
metasploit_data_models-0.6.14 db/migrate/20130228214900_change_required_columns_to_null_false_in_web_vulns.rb
metasploit_data_models-0.6.13 db/migrate/20130228214900_change_required_columns_to_null_false_in_web_vulns.rb