postgresql - Ruby on rails 5.1 upgrade, cannot name index -


i'm upgrading rails 5.1 migrations failing due index name being long.

error:

argumenterror: index name 'index_mailboxer_notifications_on_notified_object_type_and_notified_object_id' on table 'mailboxer_notifications' long; limit 63 characters 

the index name automatically gets created, should able name using name: command.

migration.rb

add_index :mailboxer_notifications, [:notified_object_id, :notified_object_type],     name: 'index_mailboxer_notifications_on_notified_object_id_and_type' 

but name: command seems getting ignored. has changed in rails 5.1? there other way name index?

in case index name long , migration failed run, should not create index.

try drop index on notified_object_id, notified_object_type columns if exists , run migration index name again.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -