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 project fund sources to reflect reorganization #1486

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mddilley
Copy link
Collaborator

@mddilley mddilley commented Nov 18, 2024

Associated issues

cityofaustin/atd-data-tech#19853

This PR updates the funding source lookup table to reflect the merge of ATD and PWD into TPW.

Testing

URL to test:

Local

Steps to test:

  1. Start your local stack and replicate from the production read replica. Then, use the two test queries below to see that there are now no project funding records that use the soft-deleted Austin Transportation and Public Works rows. There should be around 66 rows associated with the new TPW funding source.
  2. Run the same queries on the production read replica to see that the opposite is true.
  3. Check a project like ids 399, 3491, or 553 to see that the project funding records in the Funding table for these projects now show Austin Transportation and Public Works as the funding source.
  4. Try to add a new funding row in the table, and see that only Austin Transportation and Public Works is shown as a selectable source and not Austin Transportation and Public Works.
  5. Check the activity log, and you should see an activity updating the funding source that was done by Data and Tech Admin 🤖 You can check the history in the activity log too and see that the original creates and updates reflect the pre-merger names.
  6. You can also check the funding columns in the project_list_view and component_arcgis_online_view database views to see that these changes work downstream as well.

Check for project funding rows with either ATD or PWD as the funding source

WITH funding_source_todos AS (
    SELECT funding_source_id AS ids
    FROM
        moped_fund_sources
    WHERE
        funding_source_name IN (
            'Austin Transportation',
            'Public Works'
        )
)
SELECT * FROM moped_proj_funding WHERE funding_source_id IN(SELECT ids FROM funding_source_todos);

Check for project funding rows with either TPW as the funding source

WITH funding_source_todos AS (
    SELECT funding_source_id AS ids
    FROM
        moped_fund_sources
    WHERE
        funding_source_name = 'Austin Transportation and Public Works'
)
SELECT * FROM moped_proj_funding WHERE funding_source_id IN(SELECT ids FROM funding_source_todos);

Ship list

@mddilley mddilley added the WIP Work in progress label Nov 18, 2024

-- Find existing project funding records that are associated with the funding sources that are merging
-- and update them to the new funding source called Austin Transportation and Public Works
WITH funding_source_todos AS (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not entirely convinced these CTEs make this more readable since there are still sub-queries in the UPDATE statement below. Open to updating if anyone feels strongly about it!

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.

1 participant