Class: CreatePostsTable

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/forum_monster/templates/migrations/posts.rb

Class Method Summary collapse

Class Method Details

.downObject



13
14
15
# File 'lib/generators/forum_monster/templates/migrations/posts.rb', line 13

def self.down
  drop_table :posts
end

.upObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/forum_monster/templates/migrations/posts.rb', line 2

def self.up
  create_table :posts, :force => true do |t|
    t.text     :body
    t.integer  :forum_id
    t.integer  :topic_id
    t.integer  :user_id

    t.timestamps
  end
end