class AddAllowedChildrenCacheToPages < ActiveRecord::Migration
  def self.up
    add_column :pages, :allowed_children_cache, :text, default: ''
    Page.reset_column_information
    Page.find_each do |page|
      page.save # update the allowed_children_cache
    end
  end

  def self.down
    remove_column :pages, :allowed_children_cache
  end
end
class AddAllowedChildrenCacheToPages < ActiveRecord::Migration
  def self.up
    add_column :pages, :allowed_children_cache, :text
    Page.reset_column_information
    Page.find_each do |page|
      page.save # update the allowed_children_cache
    end
  end

  def self.down
    remove_column :pages, :allowed_children_cache
  end
end
Remove default because MYSQL blows up
Remove default because MYSQL blows up
