Class: CreateTopicsTable

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

Class Method Summary collapse

Class Method Details

.downObject



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

def self.down
  drop_table :topics
end

.upObject



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

def self.up
  create_table :topics, :force => true do |t|
    t.string   :title
    t.integer  :hits, :default => 0
    t.boolean  :sticky, :default => false
    t.boolean  :locked, :default => false
    t.integer  :posts_count
    t.integer  :forum_id
    t.integer  :user_id

    t.timestamps
  end
end