Forum: Ruby on Rails Migrations with multi-column indexes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Brian C. (Guest)
on 2006-03-20 23:13
(Received via mailing list)
Hey Folks,

I can't really glean this from the documentation.

Is there a way to do: add_index(table_name, column_name, index_type)
within my migration for an index that spans multiple columns?  Ie: A
covering index on FIRST_NAME, LAST_NAME or something like that?

Best,
Brian


---------------------------
Brian C.
---------------------------
Alain R. (Guest)
on 2006-03-21 01:27
(Received via mailing list)
Brian

Try

       add_index :people [:id, :first_name, :last_name], :name =>
:people_all, :unique => true

     > Is there a way to do: add_index(table_name, column_name,
index_type)
     > within my migration for an index that spans multiple columns?
Ie: A
     > covering index on FIRST_NAME, LAST_NAME or something like that?

Alain
This topic is locked and can not be replied to.