13 lines
223 B
Ruby
13 lines
223 B
Ruby
class CreatePosts < ActiveRecord::Migration
|
|
def change
|
|
create_table :posts do |t|
|
|
t.references :user
|
|
t.string :title
|
|
t.text :body
|
|
|
|
t.timestamps
|
|
end
|
|
add_index :posts, :user_id
|
|
end
|
|
end
|