Monday, December 6, 2010

Rename database column in Rails

llhttp://stackoverflow.com/questions/1992019/how-to-rename-a-database-column-in-rails-using-migration

$ script/generate migration FixColumnName
 
  def self.up
    rename_column :table_name, :old_column, :new_column
  end

$ rake db:migrate

No comments: