about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-20 19:39:18 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-20 19:39:58 +0100
commit38dd85daab8e8342ec608d24cf81254c0dfde95c (patch)
tree33502dcbfd0af447fb5b1ef7147485c8c9de95b0 /db
parentda2ef4d676ff71e6ab3edf8d1a7cee8bf6b6d353 (diff)
Adding notifications column
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161119211120_create_notifications.rb1
-rw-r--r--db/schema.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/db/migrate/20161119211120_create_notifications.rb b/db/migrate/20161119211120_create_notifications.rb
index dcbe51767..e6bf1d66e 100644
--- a/db/migrate/20161119211120_create_notifications.rb
+++ b/db/migrate/20161119211120_create_notifications.rb
@@ -9,5 +9,6 @@ class CreateNotifications < ActiveRecord::Migration[5.0]
     end
 
     add_index :notifications, :account_id
+    add_index :notifications, [:account_id, :activity_id, :activity_type], unique: true, name: 'account_activity'
   end
 end
diff --git a/db/schema.rb b/db/schema.rb
index 2bc9e5ee8..20bfb36a8 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -102,6 +102,7 @@ ActiveRecord::Schema.define(version: 20161119211120) do
     t.string   "activity_type"
     t.datetime "created_at",    null: false
     t.datetime "updated_at",    null: false
+    t.index ["account_id", "activity_id", "activity_type"], name: "account_activity", unique: true, using: :btree
     t.index ["account_id"], name: "index_notifications_on_account_id", using: :btree
   end