Answers for "how to change name of index in a table rails"

3

how to I change the name of a column in rails

$ rails g migration rename_season_to_season_id

class RenameSeasonToSeasonId < ActiveRecord::Migration
  def change
    rename_column :shoes, :season, :season_id
  end
end
Posted by: Guest on February-14-2020
0

name of index in rails migration

add_index :studies,
  ["user_id", "university_id", "subject_name_id", "subject_type_id"], 
  unique: true,
  name: 'my_index'
Posted by: Guest on November-22-2021

Code answers related to "how to change name of index in a table rails"

Browse Popular Code Answers by Language