aboutsummaryrefslogblamecommitdiffstats
path: root/guides/code/getting_started/db/migrate/20110901012815_create_comments.rb
blob: adda8078c1dbcd37264daadcc3f17dead0b5e293 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                              
class CreateComments < ActiveRecord::Migration
  def change
    create_table :comments do |t|
      t.string :commenter
      t.text :body
      t.references :post

      t.timestamps
    end
    add_index :comments, :post_id
  end
end