scinote-web/db/migrate/20160928114119_create_notifications.rb

15 lines
391 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class CreateNotifications < ActiveRecord::Migration[4.2]
def change
create_table :notifications do |t|
t.string :title
t.string :message
t.integer :type_of, null: false
2016-09-29 20:49:58 +08:00
t.integer :generator_user_id
t.timestamps null: false
end
add_index :notifications, :created_at
2016-09-29 20:49:58 +08:00
add_foreign_key :notifications, :users, column: :generator_user_id
end
end