class ActiveRecord::ConnectionAdapters::PostgreSQL::Table
def exclusion_constraint(...)
t.exclusion_constraint("price WITH =, availability_range WITH &&", using: :gist, name: "price_check")
Adds an exclusion constraint.
def exclusion_constraint(...) @base.add_exclusion_constraint(name, ...) end
def remove_exclusion_constraint(...)
t.remove_exclusion_constraint(name: "price_check")
Removes the given exclusion constraint from the table.
def remove_exclusion_constraint(...) @base.remove_exclusion_constraint(name, ...) end
def remove_unique_constraint(...)
t.remove_unique_constraint(name: "unique_position")
Removes the given unique constraint from the table.
def remove_unique_constraint(...) @base.remove_unique_constraint(name, ...) end
def unique_constraint(...)
t.unique_constraint(:position, name: 'unique_position', deferrable: :deferred, nulls_not_distinct: true)
Adds a unique constraint.
def unique_constraint(...) @base.add_unique_constraint(name, ...) end
def validate_check_constraint(...)
t.validate_check_constraint name: "price_check"
t.check_constraint("price > 0", name: "price_check", validate: false)
Validates the given check constraint on the table
def validate_check_constraint(...) @base.validate_check_constraint(name, ...) end
def validate_constraint(...)
t.validate_constraint "price_check"
t.check_constraint("price > 0", name: "price_check", validate: false)
Validates the given constraint on the table.
def validate_constraint(...) @base.validate_constraint(name, ...) end