method

check_constraint_exists?

check_constraint_exists?(*args, **options)
public

Checks if a check_constraint exists on a table.

unless t.check_constraint_exists?(name: "price_check")
  t.check_constraint("price > 0", name: "price_check")
end

See {connection.check_constraint_exists?}[rdoc-ref:SchemaStatements#check_constraint_exists?]