Class: Sequel::Postgres::AlterTableGenerator

Inherits:
Schema::AlterTableGenerator show all
Defined in:
lib/sequel/adapters/shared/postgres.rb

Instance Attribute Summary

Attributes inherited from Schema::AlterTableGenerator

#operations

Instance Method Summary collapse

Methods inherited from Schema::AlterTableGenerator

#add_column, #add_constraint, #add_foreign_key, #add_full_text_index, #add_index, #add_primary_key, #add_spatial_index, #add_unique_constraint, #drop_column, #drop_constraint, #drop_foreign_key, #drop_index, #initialize, #rename_column, #set_column_allow_null, #set_column_default, #set_column_not_null, #set_column_type

Constructor Details

This class inherits a constructor from Sequel::Schema::AlterTableGenerator

Instance Method Details

#add_exclusion_constraint(elements, opts = OPTS) ⇒ Object

Adds an exclusion constraint to an existing table, see CreateTableGenerator#exclude.



140
141
142
# File 'lib/sequel/adapters/shared/postgres.rb', line 140

def add_exclusion_constraint(elements, opts=OPTS)
  @operations << {:op => :add_constraint, :type => :exclude, :elements => elements}.merge!(opts)
end

#validate_constraint(name) ⇒ Object

Validate the constraint with the given name, which should have been added previously with NOT VALID.



146
147
148
# File 'lib/sequel/adapters/shared/postgres.rb', line 146

def validate_constraint(name)
  @operations << {:op => :validate_constraint, :name => name}
end