Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
56d102b
Mock out script and start Docker stack and readme
mddilley Oct 30, 2025
57cc6d5
Sketch out ETL steps
mddilley Oct 31, 2025
edca201
Fill in query, logging, request, and env_template; request eCAPRIS ids
mddilley Oct 31, 2025
ebccef7
Update service name and remove Oracle lib and connect
mddilley Oct 31, 2025
1f43f4c
Add migration to switch on sync; fetch project ids and unique ecapris…
mddilley Oct 31, 2025
485eed9
Add sodapy and fetch all records
mddilley Oct 31, 2025
f3f9f6f
Build list of upserts
mddilley Oct 31, 2025
739fe5a
Test upsert and add TODO for dry run flag
mddilley Oct 31, 2025
3447eba
Add handling to prevent duplicating imported or manually created FDUs
mddilley Oct 31, 2025
f39c6ad
Update mutation and constraint to prevent duplicate synced records
mddilley Oct 31, 2025
01c4e7f
Update constraint name and fix syntax
mddilley Oct 31, 2025
b6dcd17
Fix payload issues and update project query to actually include exist…
mddilley Oct 31, 2025
df4bbb2
Add args module and add dry run to skip mutation
mddilley Oct 31, 2025
40854b7
Add TODO
mddilley Nov 3, 2025
2cf0768
Merge branch 'mike/24593_fund_sync_db' into mike/24674_fund_sync_etl
mddilley Nov 3, 2025
82188a2
Add eCAPRIS subproject funding table to hold immutable FDU records
mddilley Nov 3, 2025
3b7a2a5
Update migration with combined funding DB view
mddilley Nov 3, 2025
643f1d8
Remove unneeded migration and fix table/view references
mddilley Nov 3, 2025
8e6c578
Update ETL script to upsert into ecapris_subproject_funding
mddilley Nov 3, 2025
0c88fad
Track new table and view; update permissions
mddilley Nov 3, 2025
268a976
Update funding upsert mutation
mddilley Nov 3, 2025
dcfc2b3
Fix col bug in combined view, update down migration, and col name in …
mddilley Nov 3, 2025
d463281
🤖 Export view for 24674_fund_sync_etl
Nov 3, 2025
f8aa554
Update ecapris funding view and permissions
mddilley Nov 11, 2025
b596987
Disable Hasura event triggers using moped_admin permissions
mddilley Nov 11, 2025
15977ac
Disable project updated at trigger too
mddilley Nov 11, 2025
235782a
Add indexes and update trigger disable to work with the seed data
mddilley Nov 11, 2025
354d0d4
Finish readme, update env template
mddilley Nov 11, 2025
e0aa7a0
Update down migration to remove added indexes
mddilley Nov 11, 2025
9554c2a
Merge branch 'mike/24593_fund_sync_db' into mike/24674_fund_sync_etl
mddilley Nov 11, 2025
37d7ba5
🤖 Export view for 24674_fund_sync_etl
Nov 11, 2025
bbb2c19
Update comments and formatting
mddilley Nov 13, 2025
3719682
Update view to include sync status
mddilley Nov 13, 2025
7c2bdde
Add permissions
mddilley Nov 13, 2025
cd09132
🤖 Export view for 24674_fund_sync_etl
Nov 13, 2025
fa4bb7d
Update script to use python 3.14 and add fund sync to project event t…
mddilley Nov 14, 2025
8b959b8
Split out updates needed launch day
mddilley Nov 18, 2025
726b1ff
🤖 Export view for 24674_fund_sync_etl
Nov 18, 2025
04a3dc8
Update secrets to match our secret store entries
mddilley Nov 20, 2025
e6cff46
Merge branch 'mike/24593_fund_sync_db' into mike/24674_fund_sync_etl
mddilley Nov 20, 2025
8d44b6d
Merge main and fix down migration to remove view that depends on fdu …
mddilley Nov 20, 2025
8a91434
🤖 Export view for 24674_fund_sync_etl
Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
table:
name: combined_project_funding_view
schema: public
select_permissions:
- role: moped-admin
permission:
columns:
- amount
- created_at
- description
- ecapris_subproject_id
- fao_id
- fdu
- id
- is_synced_from_ecapris
- original_id
- program_name
- project_id
- source_name
- status_name
- updated_at
filter: {}
comment: ""
- role: moped-editor
permission:
columns:
- amount
- created_at
- description
- ecapris_subproject_id
- fao_id
- fdu
- id
- is_synced_from_ecapris
- original_id
- program_name
- project_id
- source_name
- status_name
- updated_at
filter: {}
comment: ""
- role: moped-viewer
permission:
columns:
- amount
- created_at
- description
- ecapris_subproject_id
- fao_id
- fdu
- id
- is_synced_from_ecapris
- original_id
- program_name
- project_id
- source_name
- status_name
- updated_at
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table:
name: ecapris_subproject_funding
schema: public
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ insert_permissions:
updated_by_user_id: x-hasura-user-db-id
columns:
- dept_unit
- ecapris_funding_id

@mddilley mddilley Nov 13, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the same column as fao_id in the eCAPRIS data and will be populated with the unique id that we can trace back to a specific FDU's data if needed. I'm torn about the rename but fao_id is hard to parse imo. I'd love thoughts!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what does fao stand for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't know what fao stands for but can ask. FSD just let us know that this is the unique id for FDUs in their DB. What I do know is that it always makes me think of FAO Schwarz 🧸 😆

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was just curious. I also think of FAO Schwarz 🚂

- fdu
- fund
- funding_amount
Expand All @@ -36,6 +37,7 @@ insert_permissions:
updated_by_user_id: x-hasura-user-db-id
columns:
- dept_unit
- ecapris_funding_id
- fdu
- fund
- funding_amount
Expand Down Expand Up @@ -65,7 +67,6 @@ select_permissions:
- funding_source_id
- funding_status_id
- is_deleted
- is_editable

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No longer needed. All records in the moped_proj_funding table should be editable just like they are today since we aren't mixing with immutable eCAPRIS data in the same table.

- is_legacy_funding_record
- proj_funding_id
- project_id
Expand All @@ -91,7 +92,6 @@ select_permissions:
- funding_source_id
- funding_status_id
- is_deleted
- is_editable
- is_legacy_funding_record
- proj_funding_id
- project_id
Expand All @@ -117,7 +117,6 @@ select_permissions:
- funding_source_id
- funding_status_id
- is_deleted
- is_editable
- is_legacy_funding_record
- proj_funding_id
- project_id
Expand All @@ -131,6 +130,7 @@ update_permissions:
permission:
columns:
- dept_unit
- ecapris_funding_id
- fdu
- fund
- funding_amount
Expand All @@ -150,6 +150,7 @@ update_permissions:
permission:
columns:
- dept_unit
- ecapris_funding_id
- fdu
- fund
- funding_amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ event_triggers:
- project_lead_id
- public_process_status_id
- should_sync_ecapris_statuses
- should_sync_ecapris_funding
- project_name
- project_description
- ecapris_subproject_id
Expand Down
2 changes: 2 additions & 0 deletions moped-database/metadata/databases/default/tables/tables.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
- "!include deprecated_moped_project_types.yaml"
- "!include deprecated_moped_types.yaml"
- "!include public_combined_project_funding_view.yaml"
- "!include public_combined_project_notes_view.yaml"
- "!include public_component_arcgis_online_view.yaml"
- "!include public_current_phase_view.yaml"
- "!include public_ecapris_subproject_funding.yaml"
- "!include public_ecapris_subproject_statuses.yaml"
- "!include public_exploded_component_arcgis_online_view.yaml"
- "!include public_feature_drawn_lines.yaml"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- Drop combined_project_funding_view
DROP VIEW IF EXISTS combined_project_funding_view;

-- Remove funding sync flag from projects table
ALTER TABLE moped_project
DROP COLUMN should_sync_ecapris_funding;

-- Remove added columns from moped_proj_funding table
ALTER TABLE moped_proj_funding
DROP COLUMN ecapris_funding_id,
DROP COLUMN is_legacy_funding_record,
DROP COLUMN fdu,
DROP COLUMN unit_long_name;

-- Drop added indexes
DROP INDEX IF EXISTS idx_moped_proj_funding_fdu_not_deleted;
DROP INDEX IF EXISTS idx_moped_proj_funding_project_id;
DROP INDEX IF EXISTS idx_moped_proj_funding_status_id;
DROP INDEX IF EXISTS idx_moped_proj_funding_source_id;
DROP INDEX IF EXISTS idx_moped_proj_funding_program_id;

-- Drop ecapris_subproject_funding table
DROP TABLE IF EXISTS public.ecapris_subproject_funding;
Loading