Sha256: 774e2a9e97d1a029264f4222266757f8fc93984d5e8d2a43b83116c9d9d0a023

Contents?: true

Size: 370 Bytes

Versions: 5

Compression:

Stored size: 370 Bytes

Contents

class AddAllowedChildrenCacheToPages < ActiveRecord::Migration
  def self.up
    add_column :pages, :allowed_children_cache, :string, :limit => 1500, :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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
radiant-1.1.0.beta db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb
radiant-1.0.1 db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb
radiant-1.1.0.alpha db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb
radiant-1.0.0 db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb
radiant-1.0.0.rc5 db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb