Added organization_id index to notifications (#3155)

This commit is contained in:
Anna Buianova 2019-06-14 16:29:15 +03:00 committed by Ben Halpern
parent 7f2045b250
commit 8605f29b98
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,7 @@
class AddNotificationsOrganizationIdIndex < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def change
add_index :notifications, :organization_id, algorithm: :concurrently
end
end

View file

@ -12,7 +12,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_06_12_095959) do
ActiveRecord::Schema.define(version: 2019_06_14_093041) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -527,6 +527,7 @@ ActiveRecord::Schema.define(version: 2019_06_12_095959) do
t.index ["notifiable_type"], name: "index_notifications_on_notifiable_type"
t.index ["organization_id", "notifiable_id", "notifiable_type", "action"], name: "index_notifications_on_org_notifiable_and_action_not_null", unique: true, where: "(action IS NOT NULL)"
t.index ["organization_id", "notifiable_id", "notifiable_type"], name: "index_notifications_on_org_notifiable_action_is_null", unique: true, where: "(action IS NULL)"
t.index ["organization_id"], name: "index_notifications_on_organization_id"
t.index ["user_id", "notifiable_id", "notifiable_type", "action"], name: "index_notifications_on_user_notifiable_and_action_not_null", unique: true, where: "(action IS NOT NULL)"
t.index ["user_id", "notifiable_id", "notifiable_type"], name: "index_notifications_on_user_notifiable_action_is_null", unique: true, where: "(action IS NULL)"
t.index ["user_id"], name: "index_notifications_on_user_id"