I have a migration below where I create an index with an index: true. However, this name is too long for this index, so I tried to name it myself. However, this does not seem to work. I get the same "too long" error. Is there a way to name an index like this with the index: true? If not, how can I name it using add_index?
class CreateVehicleProductApplicationNotes < ActiveRecord::Migration def change create_table :vehicle_product_application_notes do |t| t.references :product_id, index: true t.references :product_application_id, index: true, :name "my_index" t.references :note_id, index: true t.timestamps end end end
source share