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. 
- 
  
    
      #alter_constraint(name, opts = OPTS)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Alter an existing constraint. 
- 
  
    
      #rename_constraint(name, new_name)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    - :inherit
- 
Set true to use INHERIT, or false to use NO INHERIT (PostgreSQL 18+). 
 
- 
  
    
      #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.
| 142 143 144 | # File 'lib/sequel/adapters/shared/postgres.rb', line 142 def add_exclusion_constraint(elements, opts=OPTS) @operations << {:op => :add_constraint, :type => :exclude, :elements => elements}.merge!(opts) end | 
#alter_constraint(name, opts = OPTS) ⇒ Object
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+) 
| 153 154 155 | # File 'lib/sequel/adapters/shared/postgres.rb', line 153 def alter_constraint(name, opts=OPTS) @operations << {:op => :alter_constraint, :name => name}.merge!(opts) end | 
#rename_constraint(name, new_name) ⇒ Object
- :inherit
- 
Set true to use INHERIT, or false to use NO INHERIT (PostgreSQL 18+) 
| 158 159 160 | # File 'lib/sequel/adapters/shared/postgres.rb', line 158 def rename_constraint(name, new_name) @operations << {:op => :rename_constraint, :name => name, :new_name => new_name} end | 
#validate_constraint(name) ⇒ Object
Validate the constraint with the given name, which should have been added previously with NOT VALID.
| 164 165 166 | # File 'lib/sequel/adapters/shared/postgres.rb', line 164 def validate_constraint(name) @operations << {:op => :validate_constraint, :name => name} end |