class PGTrunk::Operations::CheckConstraints::RenameCheckConstraint

@private

Public Instance Methods

invert() click to toggle source
# File lib/pg_trunk/operations/check_constraints/rename_check_constraint.rb, line 59
def invert
  self.class.new(**to_h, name: new_name, to: name)
end
to_sql(_version) click to toggle source
# File lib/pg_trunk/operations/check_constraints/rename_check_constraint.rb, line 51
    def to_sql(_version)
      <<~SQL.squish
        ALTER TABLE #{table.to_sql}
        RENAME CONSTRAINT #{name.name.inspect}
        TO #{new_name.name.inspect};
      SQL
    end