Method: Sequel::Schema::AlterTableGenerator#drop_constraint

Defined in:
lib/sequel/database/schema_generator.rb

#drop_constraint(name, opts = OPTS) ⇒ Object

Remove a constraint from the table:

drop_constraint(:unique_name) # DROP CONSTRAINT unique_name
drop_constraint(:unique_name, cascade: true) # DROP CONSTRAINT unique_name CASCADE

MySQL/SQLite specific options:

:type

Set the type of constraint to drop, either :primary_key, :foreign_key, or :unique.



593
594
595
596
# File 'lib/sequel/database/schema_generator.rb', line 593

def drop_constraint(name, opts=OPTS)
  @operations << {:op => :drop_constraint, :name => name}.merge!(opts)
  nil
end