method

check_constraint

rails latest stable - Class: ActiveRecord::ConnectionAdapters::Table

Method not available on this version

This method is only available on newer versions. The first available version (v8.1.1) is shown here.

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]