Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update team table so that duplicate team members cannot be added #21199

Open
mddilley opened this issue Feb 19, 2025 · 0 comments · May be fixed by cityofaustin/atd-moped#1551
Open

Update team table so that duplicate team members cannot be added #21199

mddilley opened this issue Feb 19, 2025 · 0 comments · May be fixed by cityofaustin/atd-moped#1551
Assignees
Labels
Need: 2-Should Have May be painful to leave out, but the solution is still viable Product: Moped A comprehensive mobility project tracking platform for Austin, Texas Service: Dev Infrastructure and engineering Type: Bug Report Something is not right Type: Snackoo 🍫 Small straightforward issues or fun bugs Workgroup: TPW Transportation & Public Works Department

Comments

@mddilley
Copy link

mddilley commented Feb 19, 2025

In the Team table in a project, the same person can be added more than once to the same project. Since multiple roles can be added to the same team member, there isn't a use case for adding the same person more than once.

We have 5 projects currently with duplicate people in the database (query below), and we can leave that data alone. This update would prevent this from happening more in the future. It is possible that these projects were created before we had enabled one person to have many roles or had entry error.

In Scope

  • Update the inline form to only show dropdown options that include team members not yet added to the team

Not in scope

  • Cleaning up existing data since there are only a handful of projects with duplicate personnel

SQL

SELECT
    project_id,
    user_id,
    COUNT(*) as duplicate_count
FROM
    moped_proj_personnel
WHERE is_deleted = FALSE   
GROUP BY
    project_id,
    user_id
HAVING
    COUNT(*) > 1;
@mddilley mddilley added Service: Dev Infrastructure and engineering Type: Bug Report Something is not right Type: Snackoo 🍫 Small straightforward issues or fun bugs Workgroup: TPW Transportation & Public Works Department Product: Moped A comprehensive mobility project tracking platform for Austin, Texas Need: 2-Should Have May be painful to leave out, but the solution is still viable labels Feb 19, 2025
@roseeichelmann roseeichelmann self-assigned this Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need: 2-Should Have May be painful to leave out, but the solution is still viable Product: Moped A comprehensive mobility project tracking platform for Austin, Texas Service: Dev Infrastructure and engineering Type: Bug Report Something is not right Type: Snackoo 🍫 Small straightforward issues or fun bugs Workgroup: TPW Transportation & Public Works Department
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants