class Sequel::Postgres::AlterTableGenerator
Public Instance Methods
Source
# File lib/sequel/adapters/shared/postgres.rb 140 def add_exclusion_constraint(elements, opts=OPTS) 141 @operations << {:op => :add_constraint, :type => :exclude, :elements => elements}.merge!(opts) 142 end
Adds an exclusion constraint to an existing table, see CreateTableGenerator#exclude
.
Source
# File lib/sequel/adapters/shared/postgres.rb 151 def alter_constraint(name, opts=OPTS) 152 @operations << {:op => :alter_constraint, :name => name}.merge!(opts) 153 end
Alter an existing constraint. Options:
- :deferrable
-
Modify deferrable setting for constraint (PostgreSQL 9.4+):
- true
-
DEFERRABLE INITIALLY DEFERRED
- false
-
NOT DEFERRABLE
- :immediate
-
DEFERRABLE INITIALLY IMMEDIATE
- :enforced
-
Set true to use ENFORCED, or false to use NOT ENFORCED (PostgreSQL 18+)
- :inherit
-
Set true to use INHERIT, or false to use NO INHERIT (PostgreSQL 18+)
Source
# File lib/sequel/adapters/shared/postgres.rb 157 def validate_constraint(name) 158 @operations << {:op => :validate_constraint, :name => name} 159 end
Validate the constraint with the given name, which should have been added previously with NOT VALID.