Files
nairobi/db/migrate/20150902120006_remove_parent_id_from_comments.rb
Juanjo Bazán 73f0b4b74e adds migration to remove AaCwT columns
it migrates existing comments to ancestry
2015-09-02 19:24:57 +02:00

10 lines
276 B
Ruby

class RemoveParentIdFromComments < ActiveRecord::Migration
def change
Comment.build_ancestry_from_parent_ids! rescue nil
remove_column :comments, :parent_id, :integer
remove_column :comments, :lft, :integer
remove_column :comments, :rgt, :integer
end
end