Class: CreateComments

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/db/migrate/20110110042722_create_comments.rb

Class Method Summary collapse

Class Method Details

.downObject



17
18
19
# File 'lib/generators/templates/db/migrate/20110110042722_create_comments.rb', line 17

def self.down
  drop_table :comments
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/templates/db/migrate/20110110042722_create_comments.rb', line 2

def self.up
  create_table :comments do |t|
    t.integer :post_id
    t.integer :user_id
    t.string  :name
    t.string  :email
    t.string  :url
    t.text    :message
    t.boolean :approved, :default => false
    t.datetime :approved_on

    t.timestamps
  end
end