Sha256: 863f4c2c609c1267911e8e9adf0250b0571e60c16888a06577f5703009304ef8
Contents?: true
Size: 797 Bytes
Versions: 1
Compression:
Stored size: 797 Bytes
Contents
class PageTypes < ActiveRecord::Migration def self.up add_column :pages, :content_data_id, :integer add_column :pages, :content_data_type, :string Humpyard::Page.reset_column_information create_table :pages_static_pages do |t| t.timestamps end rename_column :page_translations, :"#{Humpyard::config.table_name_prefix}page_id", :page_id Humpyard::Page.all.each do |p| sp = Humpyard::Pages::StaticPage.new sp.page = p sp.save end rename_column :page_translations, :page_id, :"#{Humpyard::config.table_name_prefix}page_id" end def self.down drop_table :pages_static_pages remove_column :pages, :content_data_id remove_column :pages, :content_data_type Humpyard::Page.reset_column_information end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
humpyard-0.0.1 | db/migrate/20100409195732_page_types.rb |