Class: CreateForumsTable

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

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/generators/forum_monster/templates/migrations/forums.rb', line 16

def self.down
  drop_table :forums
end

.upObject



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

def self.up
  create_table :forums, :force => true do |t|
    t.string   :title
    t.text     :description
    t.boolean  :state, :default => true
    t.integer  :topics_count, :default => 0
    t.integer  :posts_count, :default => 0
    t.integer  :position, :default => 0
    t.integer  :category_id

    t.timestamps
  end
end