Answers for "ruby rails how to change the name of a column in table"

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

Code answers related to "ruby rails how to change the name of a column in table"

Browse Popular Code Answers by Language