Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
8450fe30
Commit
8450fe30
authored
Jun 03, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index to notification settings
parent
ca3c5c29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
CHANGELOG
CHANGELOG
+1
-0
db/migrate/20160603180330_remove_duplicated_notification_settings.rb
...20160603180330_remove_duplicated_notification_settings.rb
+7
-0
db/migrate/20160603182247_add_index_to_notification_settings.rb
...rate/20160603182247_add_index_to_notification_settings.rb
+9
-0
lib/gitlab/database/migration_helpers.rb
lib/gitlab/database/migration_helpers.rb
+5
-1
No files found.
CHANGELOG
View file @
8450fe30
...
...
@@ -34,6 +34,7 @@ v 8.9.0 (unreleased)
- Cache project build count in sidebar nav
- Reduce number of queries needed to render issue labels in the sidebar
- Improve error handling importing projects
- Remove duplicated notification settings
- Put project Files and Commits tabs under Code tab
v 8.8.4
...
...
db/migrate/20160603180330_remove_duplicated_notification_settings.rb
0 → 100644
View file @
8450fe30
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
db/migrate/20160603182247_add_index_to_notification_settings.rb
0 → 100644
View file @
8450fe30
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
lib/gitlab/database/migration_helpers.rb
View file @
8450fe30
...
...
@@ -19,7 +19,11 @@ module Gitlab
end
if
Database
.
postgresql?
args
<<
{
algorithm: :concurrently
}
if
args
[
2
].
present?
args
[
2
].
merge!
({
algorithm: :concurrently
})
else
args
<<
{
algorithm: :concurrently
}
end
end
add_index
(
*
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment