Per the following conversation, Postgres supports the ability to add a 
unique index using an existing index, rather than creating a duplicate 
index on a column:
https://stackoverflow.com/questions/23542794/postgres-unique-constraint-vs-index

See Postgres documentation as well: 
https://www.postgresql.org/docs/9.1/static/sql-altertable.html

It would be pretty useful if the alter_table method, add_unqiue_constraint 
could take a "using" parameter to utilize an existing index rather than 
creating another 

alter_table :table do
add_unique_constraint :code_value, using: :table_code_value_index
end

-- 
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.

Reply via email to