Class: PGTrunk::Operations::CheckConstraints::AddCheckConstraint

Inherits:
Base show all
Defined in:
lib/pg_trunk/operations/check_constraints/add_check_constraint.rb

Instance Method Summary collapse

Methods inherited from Base

#<=>

Methods included from PGTrunk::Operation::SQLHelpers

#quote

Methods included from PGTrunk::Operation::RubyHelpers

#dump, #to_a, #to_opts, #to_ruby

Methods included from PGTrunk::Operation::Inversion

#invert!, #irreversible!

Methods included from PGTrunk::Operation::Validations

#error_messages

Methods included from PGTrunk::Operation::Attributes

#attributes, #initialize

Instance Method Details

#invertObject



83
84
85
# File 'lib/pg_trunk/operations/check_constraints/add_check_constraint.rb', line 83

def invert
  DropCheckConstraint.new(**to_h)
end

#to_sql(_version) ⇒ Object



79
80
81
# File 'lib/pg_trunk/operations/check_constraints/add_check_constraint.rb', line 79

def to_sql(_version)
  [add_constraint, *add_comment, register_constraint].compact.join(" ")
end