Sha256: 83eb57a2d97b7926f99c1928431ca30644fe8dc3d6eaa00209ee691b44fbe381

Contents?: true

Size: 711 Bytes

Versions: 5

Compression:

Stored size: 711 Bytes

Contents

class CreatePagesAndCategories < ActiveRecord::Migration
  def self.up
    create_table :pages do |t|
      t.string  :title
      t.text    :content
      t.text    :content_html
      t.string  :link
      t.string  :state
      t.datetime :published_at
      t.datetime :archived_at
      t.integer   :category_id
      t.timestamps
    end
    
    create_table :categories do |t|
      t.string  :name
      
      # nested_sey
      t.integer :parent_id
      t.integer :lft
      t.integer :rgt
      t.integer :depth

      # acts_as_list
      t.integer :position
      
      t.string  :link
      t.timestamps
    end
  end

  def self.down
    drop_table :pages
    drop_table :categories
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
merrycms-0.1.7 lib/generators/merrycms/templates/create_pages_and_categories_migration.rb
merrycms-0.1.4 lib/generators/merrycms/templates/create_pages_and_categories_migration.rb
merrycms-0.1.2 lib/generators/merrycms/templates/create_pages_and_categories_migration.rb
merrycms-0.1.1 lib/generators/merrycms/templates/create_pages_and_categories_migration.rb
merrycms-0.1.0 lib/generators/merrycms/templates/create_pages_and_categories_migration.rb