Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #I #change #column #rails
ADD COMMENT
Topic
Name
7+4 =