Class: Dbsketch::Comparison::TableDiff
- Defined in:
- lib/dbsketch/comparison/table_comparator.rb
Instance Attribute Summary collapse
-
#check_constraints ⇒ Object
readonly
Returns the value of attribute check_constraints.
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#foreign_keys ⇒ Object
readonly
Returns the value of attribute foreign_keys.
-
#primary_key ⇒ Object
readonly
Returns the value of attribute primary_key.
-
#unique_constraints ⇒ Object
readonly
Returns the value of attribute unique_constraints.
Attributes inherited from Diff
Instance Method Summary collapse
-
#initialize(old_table, new_table, columns, primary_key, check_constraints, foreign_keys, unique_constraints) ⇒ TableDiff
constructor
A new instance of TableDiff.
Methods inherited from Diff
#addition?, #change?, #deletion?
Constructor Details
#initialize(old_table, new_table, columns, primary_key, check_constraints, foreign_keys, unique_constraints) ⇒ TableDiff
Returns a new instance of TableDiff.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/dbsketch/comparison/table_comparator.rb', line 18 def initialize(old_table, new_table, columns, primary_key, check_constraints, foreign_keys, unique_constraints) super old_table, new_table ### Preconditions raise ArgumentError, "old_table is not a Dbsketch::Model::Table" unless nil == old_table or old_table.is_a? Dbsketch::Model::Table raise ArgumentError, "new_table is not a Dbsketch::Model::Table" unless nil == new_table or new_table.is_a? Dbsketch::Model::Table check_constraints.each_with_index { |diff, index| raise ArgumentError, "check_constraints[#{index}] is not a Dbsketch::Comparison::CheckConstraintDiff" unless diff.is_a? Dbsketch::Comparison::CheckConstraintDiff } ### @columns = columns @primary_key = primary_key @check_constraints = check_constraints @foreign_keys = foreign_keys @unique_constraints = unique_constraints end |
Instance Attribute Details
#check_constraints ⇒ Object (readonly)
Returns the value of attribute check_constraints.
32 33 34 |
# File 'lib/dbsketch/comparison/table_comparator.rb', line 32 def check_constraints @check_constraints end |
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
32 33 34 |
# File 'lib/dbsketch/comparison/table_comparator.rb', line 32 def columns @columns end |
#foreign_keys ⇒ Object (readonly)
Returns the value of attribute foreign_keys.
32 33 34 |
# File 'lib/dbsketch/comparison/table_comparator.rb', line 32 def foreign_keys @foreign_keys end |
#primary_key ⇒ Object (readonly)
Returns the value of attribute primary_key.
32 33 34 |
# File 'lib/dbsketch/comparison/table_comparator.rb', line 32 def primary_key @primary_key end |
#unique_constraints ⇒ Object (readonly)
Returns the value of attribute unique_constraints.
32 33 34 |
# File 'lib/dbsketch/comparison/table_comparator.rb', line 32 def unique_constraints @unique_constraints end |