Class: CreateCategoriesTable

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

Class Method Summary collapse

Class Method Details

.downObject



12
13
14
# File 'lib/generators/forum_monster/templates/migrations/categories.rb', line 12

def self.down
  drop_table :categories
end

.upObject



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

def self.up
  create_table :categories, :force => true do |t|
    t.string   :title
    t.boolean  :state, :default => true
    t.integer  :position, :default => 0

    t.timestamps
  end
end