On Monday, July 23, 2018 at 1:07:49 PM UTC-7, Hugh Gardiner wrote:
>
> 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
>

Considering this feature is PostgreSQL-specific and easily to use via 
custom SQL, I'm not sure it is worth adding DSL support for.  However, I 
probably would not reject a pull request for it, assuming it came with 
integration tests. 

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.

Reply via email to