Skip to content

Instantly share code, notes, and snippets.

@ka8725
Forked from EnotPoloskunAndIluhaAndr/gist:1782998
Created February 9, 2012 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ka8725/1783006 to your computer and use it in GitHub Desktop.
Save ka8725/1783006 to your computer and use it in GitHub Desktop.
class AddNewFieldsToComments < ActiveRecord::Migration
def self.up
add_column :comments, :ip, :string
add_column :comments, :rate, :integer
add_column :comments, :email, :string
add_column :comments, :user_name, :string
add_column :comments, :description, :text
add_column :comments, :page_id, :integer
remove_column :comments, :title
remove_column :comments, :comment
end
def self.down
remove_column :comments, :ip
remove_column :comments, :rate
remove_column :comments, :email
remove_column :comments, :user_name
remove_column :comments, :description
remove_column :comments, :page_id
add_column :comments, :title, :string
add_column :comments, :comment, :text
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment