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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b25319f9
Commit
b25319f9
authored
Feb 21, 2018
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More readable SQL query.
parent
3dbec2c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
app/finders/members_finder.rb
app/finders/members_finder.rb
+7
-3
No files found.
app/finders/members_finder.rb
View file @
b25319f9
...
@@ -38,9 +38,13 @@ class MembersFinder
...
@@ -38,9 +38,13 @@ class MembersFinder
<<~
SQL
<<~
SQL
SELECT DISTINCT ON (user_id, invite_email) member_union.*
SELECT DISTINCT ON (user_id, invite_email) member_union.*
FROM (
#{
union
.
to_sql
}
) AS member_union
FROM (
#{
union
.
to_sql
}
) AS member_union
ORDER BY
ORDER BY user_id,
user_id, invite_email,
invite_email,
CASE WHEN type = 'ProjectMember' THEN 1 WHEN type = 'GroupMember' THEN 2 ELSE 3 END
CASE
WHEN type = 'ProjectMember' THEN 1
WHEN type = 'GroupMember' THEN 2
ELSE 3
END
SQL
SQL
else
else
# Older versions of MySQL do not support window functions (and DISTINCT ON is postgres-specific).
# Older versions of MySQL do not support window functions (and DISTINCT ON is postgres-specific).
...
...
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