Class: CreatePostCategories

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/forge/db/migrate/20130405172025_create_post_categories.rb

Instance Method Summary collapse

Instance Method Details

#downObject



16
17
18
19
# File 'lib/forge/db/migrate/20130405172025_create_post_categories.rb', line 16

def down
  drop_table :post_categories
  drop_table :post_categories_posts
end

#upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/forge/db/migrate/20130405172025_create_post_categories.rb', line 2

def up
  create_table "post_categories" do |t|
    t.string   "title"
    t.integer  "list_order", :default => 999
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "post_categories_posts", :id => false do |t|
    t.integer "post_category_id"
    t.integer "post_id"
  end
end