Class: CreatePosts

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

Instance Method Summary collapse

Instance Method Details

#downObject



25
26
27
# File 'lib/forge/db/migrate/20130405172024_create_posts.rb', line 25

def down
  drop_table :posts
end

#upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/forge/db/migrate/20130405172024_create_posts.rb', line 2

def up
  create_table "posts", :force => true do |t|
    t.string   "title"
    t.text     "content"
    t.integer  "user_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "allow_comments",  :default => true,  :null => false
    t.integer  "creator_id"
    t.integer  "updater_id"
    t.boolean  "published",       :default => false
    t.text     "excerpt"
    t.string   "seo_title"
    t.text     "seo_keywords"
    t.text     "seo_description"
  end

  add_index "posts", ["created_at"], :name => "index_posts_on_created_at"
  add_index "posts", ["creator_id"], :name => "index_posts_on_creator_id"
  add_index "posts", ["updater_id"], :name => "index_posts_on_updater_id"
  add_index "posts", ["user_id"], :name => "index_posts_on_user_id"
end