instance method
check_constraint_exists?
Ruby on Rails 7.2.3
Since v7.1.6Signature
check_constraint_exists?(*args, **options)
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
Parameters
-
argsrest -
optionskeyrest
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 944
def check_constraint_exists?(*args, **options)
@base.check_constraint_exists?(name, *args, **options)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb line 944
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Table