Class: Sequel::Postgres::AlterTableGenerator
- Inherits:
-
Schema::AlterTableGenerator
- Object
- Schema::AlterTableGenerator
- Sequel::Postgres::AlterTableGenerator
- Defined in:
- lib/sequel/adapters/shared/postgres.rb
Instance Attribute Summary
Attributes inherited from Schema::AlterTableGenerator
Instance Method Summary collapse
-
#add_exclusion_constraint(elements, opts = OPTS) ⇒ Object
Adds an exclusion constraint to an existing table, see CreateTableGenerator#exclude.
-
#validate_constraint(name) ⇒ Object
Validate the constraint with the given name, which should have been added previously with NOT VALID.
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.
74 75 76 |
# File 'lib/sequel/adapters/shared/postgres.rb', line 74 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.
80 81 82 |
# File 'lib/sequel/adapters/shared/postgres.rb', line 80 def validate_constraint(name) @operations << {:op => :validate_constraint, :name => name} end |