cityofaustin / atd-vz-data

The technology that powers the City of Austin's Vision Zero program
https://visionzero.austin.gov/viewer/
11 stars 2 forks source link

Make crash notes and recommendations compatible with the new data model #1481

Closed roseeichelmann closed 1 month ago

roseeichelmann commented 1 month ago

Associated issues

Closes https://github.com/cityofaustin/atd-data-tech/issues/18045

Testing

URL to test:

  1. Check out this branch and follow instructions in https://github.com/cityofaustin/atd-vz-data/pull/1440 to start the data model, apply migrations and run the CRIS import ETL
  2. You will need to open up your hasura console or whatever database tool you prefer. Go to the recommendations table, find a recommendation. Copy the atd_txdot_crashes_crash_id. In the crashes table use that to find the id pkey for that crash, copy that. Now in the recommendations table edit the record and put the id pkey for the crash in the crash_id column of the recommendation.
  3. Now in the VZE go to that crash, you should see the recommendation pop up for it now. Test editing diff parts of the recommendation.
  4. Now create some new notes for the crash and edit/delete them.
  5. You can also do the same thing you did in steps 2-3 but for a note.

Sorry these test instructions are weird, just wanted to get this PR aligned as much as possible with the new data model so that next we will just backfill the notes/recommendations with the correct id pkey in the crash_id column and then will be able to delete the atd_txdot_crashes_crash_id we have here all together.

Steps to test:


Ship list

roseeichelmann commented 1 month ago

Also -- i know how confusing and contradicting all the various id and crash_id and cris_crash_id and atd_txdot_crashes_crash_id's are. I think we are gonna talk about ways to name these columns so its less confusing in our next data model meeting. I floated to john the following idea - in the crashes table, we have our internal id pkey and a column called cris_crash_id for the classic crash id we know and love. in other tables we have a column called crash_pk that references the id of the crashes table, and then a column cris_crash_id that references the cris_crash_id of crashes if necessary. just a thought :shrug:

mddilley commented 1 month ago

Also, about the crash_pk columns, i think that you are on to something. Seeing the crashPk variable name in the code made it clearer to me that it was using the internal (non-CRIS) id. 💯