Class: Dbsketch::Comparison::ComputedColumnDiff

Inherits:
Diff
  • Object
show all
Defined in:
lib/dbsketch/comparison/computed_column_comparator.rb

Instance Attribute Summary collapse

Attributes inherited from Diff

#new_value, #old_value

Instance Method Summary collapse

Methods inherited from Diff

#addition?, #change?, #deletion?

Constructor Details

#initialize(old_column, new_column, options) ⇒ ComputedColumnDiff

Returns a new instance of ComputedColumnDiff.



13
14
15
16
17
18
19
20
21
# File 'lib/dbsketch/comparison/computed_column_comparator.rb', line 13

def initialize old_column, new_column, options
	super old_column, new_column
	if change?
		@query = Diff.new(old_column.query, new_column.query) if old_column.query != new_column.query
		@nullable = Diff.new(old_column.nullable, new_column.nullable) if old_column.nullable != new_column.nullable
		@order = Diff.new(old_column.order, new_column.order) if options[:compare_order] and old_column.order != new_column.order
		@persisted = Diff.new(old_column.persisted, new_column.persisted) if old_column.persisted != new_column.persisted
	end
end

Instance Attribute Details

#nullableObject (readonly)

Returns the value of attribute nullable.



23
24
25
# File 'lib/dbsketch/comparison/computed_column_comparator.rb', line 23

def nullable
  @nullable
end

#orderObject (readonly)

Returns the value of attribute order.



23
24
25
# File 'lib/dbsketch/comparison/computed_column_comparator.rb', line 23

def order
  @order
end

#persistedObject (readonly)

Returns the value of attribute persisted.



23
24
25
# File 'lib/dbsketch/comparison/computed_column_comparator.rb', line 23

def persisted
  @persisted
end

#queryObject (readonly)

Returns the value of attribute query.



23
24
25
# File 'lib/dbsketch/comparison/computed_column_comparator.rb', line 23

def query
  @query
end