Skip to content
Snippets Groups Projects
Commit 8450fe30 authored by Felipe Artur's avatar Felipe Artur
Browse files

Add index to notification settings

parent ca3c5c29
No related branches found
No related tags found
No related merge requests found
Loading
@@ -34,6 +34,7 @@ v 8.9.0 (unreleased)
Loading
@@ -34,6 +34,7 @@ v 8.9.0 (unreleased)
- Cache project build count in sidebar nav - Cache project build count in sidebar nav
- Reduce number of queries needed to render issue labels in the sidebar - Reduce number of queries needed to render issue labels in the sidebar
- Improve error handling importing projects - Improve error handling importing projects
- Remove duplicated notification settings
- Put project Files and Commits tabs under Code tab - Put project Files and Commits tabs under Code tab
   
v 8.8.4 v 8.8.4
Loading
Loading
class RemoveDuplicatedNotificationSettings < ActiveRecord::Migration
def up
execute <<-SQL
DELETE FROM notification_settings WHERE id NOT IN ( SELECT min_id from (SELECT MIN(id) as min_id FROM notification_settings GROUP BY user_id, source_type, source_id) as dups )
SQL
end
end
class AddIndexToNotificationSettings < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
def change
add_concurrent_index :notification_settings, [:user_id, :source_id, :source_type], { unique: true, name: "index_notifications_on_user_id_and_source_id_and_source_type" }
end
end
Loading
@@ -19,7 +19,11 @@ module Gitlab
Loading
@@ -19,7 +19,11 @@ module Gitlab
end end
   
if Database.postgresql? if Database.postgresql?
args << { algorithm: :concurrently } if args[2].present?
args[2].merge!({ algorithm: :concurrently })
else
args << { algorithm: :concurrently }
end
end end
   
add_index(*args) add_index(*args)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment