On Thursday, May 19, 2016 at 1:25:57 PM UTC-7, Andrew Burleson wrote: > > If you created a unique constraint like this: > > create_table :foos do > column :foo_count, Integer, null: false, unique: true > end > > How can you then drop the unique constraint? > > I noticed that alter_table has an add_unique_constraint method and tried > drop_unique_constraint, but that gave me a NoMethodError. >
alter_table :foos do drop_constraint :name_of_constraint end Since you didn't provide the name of the constraint, the database picked one for you. You'll need to use the database's tools to figure out the name of the constraint. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
