react-code-dataset / Facebook-Clone /db /migrate /20180613072627_create_comments.rb
Devendra174's picture
Upload folder using huggingface_hub
f5071ca verified
raw
history blame contribute delete
289 Bytes
class CreateComments < ActiveRecord::Migration[5.2]
def change
create_table :comments do |t|
t.integer :author_id,null:false
t.text :body,null:false
t.integer :post_id,null:false
end
add_index :comments,:author_id
add_index :comments,:post_id
end
end