mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-22 23:48:18 +08:00
14 lines
328 B
Ruby
14 lines
328 B
Ruby
|
class CreateComments < ActiveRecord::Migration
|
||
|
def change
|
||
|
create_table :comments do |t|
|
||
|
t.string :message, null: false
|
||
|
t.integer :user_id, null: false
|
||
|
|
||
|
t.timestamps null: false
|
||
|
end
|
||
|
add_foreign_key :comments, :users
|
||
|
add_index :comments, :user_id
|
||
|
add_index :comments, :created_at
|
||
|
end
|
||
|
end
|