instance method exclusion_constraint_exists?

Ruby on Rails edge

Since edge

Signature

exclusion_constraint_exists?(*args, **options)

Checks if an exclusion constraint exists on a table.

unless t.exclusion_constraint_exists?(name: "invoices_date_overlap")
  t.exclusion_constraint("daterange(start_date, end_date) WITH &&", using: :gist, name: "invoices_date_overlap")
end

See connection.exclusion_constraint_exists?

Parameters

args rest
options keyrest
Source
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 327
        def exclusion_constraint_exists?(*args, **options)
          @base.exclusion_constraint_exists?(name, *args, **options)
        end

Defined in activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb line 327 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::PostgreSQL::Table

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close