Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Merge requests
!1301
remove duplicate staff entries from qa_staff
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
remove duplicate staff entries from qa_staff
remove_duplicate_staff
into
main
Overview
2
Commits
1
Pipelines
1
Changes
1
1 unresolved thread
Hide all comments
Merged
Charlotte Hausman
requested to merge
remove_duplicate_staff
into
main
1 year ago
Overview
2
Commits
1
Pipelines
1
Changes
1
1 unresolved thread
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
3a04f4e9
Show latest version
1 file
+
27
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
3a04f4e9
remove duplicate staff entries from qa_staff
· 3a04f4e9
Charlotte Hausman
authored
1 year ago
shared/workspaces/alembic/versions/68a8ad53ad74_change_qa_terminology.py
+
27
−
0
Options
@@ -41,6 +41,33 @@ def upgrade():
WHERE
"
group
"
=
'
DA
'
;
"""
)
# Remove duplicate entries
op
.
execute
(
"""
CREATE TABLE qa_staff_tmp (LIKE qa_staff);
"""
)
op
.
execute
(
"""
INSERT INTO qa_staff_tmp(user_name,
"
group
"
, available, email)
SELECT
DISTINCT ON (user_name,
"
group
"
) user_name,
"
group
"
, available, email
Daniel Lyons
@dlyons
·
1 year ago
Owner
I haven't seen
DISTINCT ON
before, that's cool!
Collapse replies
Charlotte Hausman
@chausman
·
1 year ago
Author
Owner
I hadn't before either, very useful that
Please
register
or
sign in
to reply
Please
register
or
sign in
to reply
FROM qa_staff;
"""
)
op
.
execute
(
"""
DROP TABLE qa_staff;
"""
)
op
.
execute
(
"""
ALTER TABLE qa_staff_tmp
RENAME TO qa_staff;
"""
)
# Put back unique constraint
op
.
execute
(
"""
ALTER TABLE qa_staff
Loading
I haven't seen
DISTINCT ON
before, that's cool!I hadn't before either, very useful that