Class: CreateComments

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

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/generators/bumble/templates/migrations/create_comments.rb', line 16

def self.down
  drop_table :comments
end

.upObject



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

def self.up
  create_table :comments do |t|
    t.text     :body
    t.integer  :post_id
    t.integer  :user_id
    t.string   :author_name
    t.string   :author_email
    t.string   :author_url
    t.datetime :deleted_at

    t.timestamps
  end
end