20161119211120_create_notifications.rb 422 B

12345678910111213141516
  1. # frozen_string_literal: true
  2. class CreateNotifications < ActiveRecord::Migration[5.0]
  3. def change
  4. create_table :notifications do |t|
  5. t.integer :account_id
  6. t.integer :activity_id
  7. t.string :activity_type
  8. t.timestamps
  9. end
  10. add_index :notifications, :account_id
  11. add_index :notifications, [:account_id, :activity_id, :activity_type], unique: true, name: 'account_activity'
  12. end
  13. end