instance method
check_constraint
Ruby on Rails 7.2.3
Since v6.1.7.10Signature
check_constraint(*args, **options)
Adds a check constraint.
t.check_constraint("price > 0", name: "price_check")
Parameters
-
argsrest -
optionskeyrest
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 924
def check_constraint(*args, **options)
@base.add_check_constraint(name, *args, **options)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb line 924
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Table