ch3ru
0
Q:

how do I add index's to a migration in rails

rails generate migration AddUser_idColumnToTable user_id:string. 

class AddIndexToTable < ActiveRecord::Migration
  def change
    add_index :table, :user_id
  end
end
0

New to Communities?

Join the community