2013-01-07 09:04:09 +01:00
|
|
|
class ActsAsCommentableUpgradeMigration < ActiveRecord::Migration
|
|
|
|
|
def self.up
|
|
|
|
|
rename_column :comments, :comment, :body
|
|
|
|
|
add_column :comments, :subject, :string
|
|
|
|
|
add_column :comments, :parent_id, :integer
|
|
|
|
|
add_column :comments, :lft, :integer
|
|
|
|
|
add_column :comments, :rgt, :integer
|
|
|
|
|
end
|
2014-08-18 21:26:45 +03:00
|
|
|
|
2013-01-07 09:04:09 +01:00
|
|
|
def self.down
|
|
|
|
|
rename_column :comments, :body, :comment
|
|
|
|
|
remove_column :comments, :subject
|
|
|
|
|
remove_column :comments, :parent_id
|
|
|
|
|
remove_column :comments, :lft
|
|
|
|
|
remove_column :comments, :rgt
|
|
|
|
|
end
|
|
|
|
|
end
|