Active Record PostgreSQL Adapter Table

Methods

Included Modules

Instance Public methods

exclusion_constraint(*args)

Adds an exclusion constraint.

t.exclusion_constraint("price WITH =, availability_range WITH &&", using: :gist, name: "price_check")

See connection.add_exclusion_constraint

📝 Source code
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 305
        def exclusion_constraint(*args)
          @base.add_exclusion_constraint(name, *args)
        end
🔎 See on GitHub

remove_exclusion_constraint(*args)

Removes the given exclusion constraint from the table.

t.remove_exclusion_constraint(name: "price_check")

See connection.remove_exclusion_constraint

📝 Source code
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 314
        def remove_exclusion_constraint(*args)
          @base.remove_exclusion_constraint(name, *args)
        end
🔎 See on GitHub

remove_unique_constraint(*args)

Removes the given unique constraint from the table.

t.remove_unique_constraint(name: "unique_position")

See connection.remove_unique_constraint

📝 Source code
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 332
        def remove_unique_constraint(*args)
          @base.remove_unique_constraint(name, *args)
        end
🔎 See on GitHub

unique_constraint(*args)

Adds a unique constraint.

t.unique_constraint(:position, name: 'unique_position', deferrable: :deferred)

See connection.add_unique_constraint

📝 Source code
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 323
        def unique_constraint(*args)
          @base.add_unique_constraint(name, *args)
        end
🔎 See on GitHub

validate_check_constraint(*args)

Validates the given check constraint on the table

t.check_constraint("price > 0", name: "price_check", validate: false)
t.validate_check_constraint name: "price_check"

See connection.validate_check_constraint

📝 Source code
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 352
        def validate_check_constraint(*args)
          @base.validate_check_constraint(name, *args)
        end
🔎 See on GitHub

validate_constraint(*args)

Validates the given constraint on the table.

t.check_constraint("price > 0", name: "price_check", validate: false)
t.validate_constraint "price_check"

See connection.validate_constraint

📝 Source code
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 342
        def validate_constraint(*args)
          @base.validate_constraint(name, *args)
        end
🔎 See on GitHub