Class: MetasploitDataModels::ChangeRequiredColumnsToNullFalse
- Inherits:
-
Object
- Object
- MetasploitDataModels::ChangeRequiredColumnsToNullFalse
- Defined in:
- lib/metasploit_data_models/change_required_columns_to_null_false.rb
Overview
Changes all the COLUMNS in the table with TABLE_NAME that are required from the table's mode, but were previously
:null => true
, to :null => false
.
@abstract Subclass and define COLUMNS as Array
Instance Method Summary collapse
-
#down ⇒ Object
Marks all the COLUMNS as
:null => true
. -
#up ⇒ Object
Marks all the COLUMNS as
:null => false
.
Instance Method Details
#down ⇒ Object
Marks all the COLUMNS as :null => true
7 8 9 10 11 12 |
# File 'lib/metasploit_data_models/change_required_columns_to_null_false.rb', line 7 def down # Use self.class:: so constants are resolved in subclasses instead of this class. self.class::COLUMNS.each do |column| change_column_null(self.class::TABLE_NAME, column, true) end end |
#up ⇒ Object
Marks all the COLUMNS as :null => false
15 16 17 18 19 20 |
# File 'lib/metasploit_data_models/change_required_columns_to_null_false.rb', line 15 def up # Use self.class:: so constants are resolved in subclasses instead of this class. self.class::COLUMNS.each do |column| change_column_null(self.class::TABLE_NAME, column, false) end end |