Sha256: d0c2c2be2e451cee511f4afd5ef4e37191c0914dc7852f77deec855bcd402d17

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

class NewsPage < ActiveRecord::Migration
  def self.up
    #Remove old news stuff if exists
    # begin
    #   drop_table :news_feed_translations
    # rescue
    # end
    # begin
    #   drop_table :news_feeds
    # rescue
    # end
    # begin
    #   drop_table :news_item_translations
    # rescue
    # end
    # begin
    #   drop_table :news_items
    # rescue
    # end    
    
    create_table :pages_news_pages do |t|
      t.timestamps
      t.datetime :deleted_at
    end
        
    create_table :news_items do |t|
      t.references :news_page
      t.datetime :published_at
      t.timestamps
      t.datetime :deleted_at
    end
    
    create_table :news_item_translations do |t|
      t.references :"#{Humpyard::config.table_name_prefix}news_items"
      t.string :locale
      t.string :title
      t.string :title_for_url 
      t.text :description 
      t.timestamps
    end
  end

  def self.down
    drop_table :news_item_translations
    drop_table :news_items
    drop_table :pages_news_pages
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
humpyard-0.0.1 db/migrate/20100415132312_news_page.rb