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 moped_workgroup to reflect reorganization #1515

Merged
merged 3 commits into from
Jan 2, 2025

Conversation

mddilley
Copy link
Collaborator

@mddilley mddilley commented Dec 20, 2024

Associated issues

Closes cityofaustin/atd-data-tech#19854

This PR updates workgroups with Sidewalks and Urban Trails and updates any users with Sidewalks or Urban Trails as their workgroup to fall under the new workgroup.

Testing

URL to test:

Local

Steps to test:

  1. Start your local stack with production data
  2. Explore the moped_workgroup table and see that:
    • there is now a soft-delete column
    • the Sidewalks row is soft-deleted
    • the Urban Trails row is soft-deleted
    • there is now a row for Sidewalks and Urban Trails (SUTD)
  3. Log into the Moped app as an admin (Moped Test Admin in our vault or your own account) so you can see the staff form in later steps and then go to the Staff tab
  4. Filter the staff table's Workgroup column to Sidewalks and you should only see users with Sidewalks and Urban Trails workgroups
  5. Click the "Add Staff" button and check the input for Workgroup to make sure that only Sidewalks and Urban Trails is available to select
  6. Note a user from this table that has SUTD as their workgroup. Then, go to a project and add this user to a project team. You should see that the workgroup shown in the table is accurate too.
  7. You can test these steps with the test editor account too but the "Add Staff" button should not be available.

Ship list

Copy link
Contributor

@mateoclarke mateoclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sidewalks 🤝 Urban Trails

powers_combine

I went through the testing steps and everything worked as described.

@@ -0,0 +1,3 @@
-- Updating moped_workgroup table will be up only. If we need to revert, we will need do it manually or
-- update with a future migration.
SELECT 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this is what I should've done on my last update to the moped_fund_status table.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like what you've got, Mateo. It reverts back to the previous DB state cleanly ✅ 🚢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 - i like the down migration for the funding descriptions too. i've been omitting down migrations for these reorg changes since they update records in other tables and would take some heavier lifting to go back.

SET
workgroup_id = (SELECT id FROM new_workgroup_row)
WHERE
workgroup_id IN (SELECT ids FROM user_todos);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty slick way of doing this—nice!

Copy link
Member

@johnclary johnclary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! congrats to the urban sidewalks division

moped_workgroup(
order_by: { workgroup_name: asc }
where: { is_deleted: { _eq: false } }
) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! i did a quick scan of instances of moped_workgroup in the editor and couldn't find anything else that would be affected by this 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for checking! 🙏

@mddilley mddilley merged commit 0ca7460 into main Jan 2, 2025
5 checks passed
@mddilley mddilley deleted the mike/19854_workgroup_reorg branch January 2, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update moped_workgroup to reflect reorganization
3 participants