method
check_constraint
v8.1.1 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::Table
check_constraint(*args, **options)public
Adds a check constraint.
t.check_constraint("price > 0", name: "price_check")
See {connection.add_check_constraint}[rdoc-ref:SchemaStatements#add_check_constraint]