restored my local DB to before the problematic migration
used the local webapp to ensure that the audit log had a range of events, including "Map Generated"
checked out this branch
ran npx supabase migrations up --include-all --local
checked that the DB looked as expected
tested the local webapp to verify all was as expected, including the audit log
Before deployment, I've also checked that the dev DB's Migrations table does not say that this migration has been run yet.
AI generated change summary
The following is a summary of the changes in the PR generated by What The Diff.
Delete the command below if you don't want this to be generataed.
Event ID Update in Audit Log
The PR adds an update statement that removes event_id from the audit_log table for entries where event_id is linked with 'Map Generated' status in the events table.
Removal of 'Map Generated' Events
Any rows in the events table with new_parcel_status as 'Map Generated' have been deleted.
Removal of 'Map Generated' Status Orders
Similarly, entries from the status_order table are removed where the event_name is marked as 'Map Generated'.
Status Order event_name Update
If the event_name in the status_order table was previously labeled as 'No Status', it has now been updated to an empty string ('') as the new value.
Workflow Order Resetting for No Event Status
The workflow_order for rows in the status_order table where the event_name is an empty string ('') has been reset to have the value 0. This essentially prioritizes these rows at the base level in the workflow order.
… audit log constraint
What's changed
Sorry, the migration in PR #436 didn't check for audit log constraint before deleting a defunct status event. https://github.com/NorwoodAndBrixtonFoodbank/nbf-website/actions/runs/10061976750/job/27813328454
Therefore I'm editing that migration here.
Testing
I did the following:
npx supabase migrations up --include-all --local
Before deployment, I've also checked that the
dev
DB's Migrations table does not say that this migration has been run yet.AI generated change summary
The following is a summary of the changes in the PR generated by What The Diff. Delete the command below if you don't want this to be generataed.
Event ID Update in Audit Log The PR adds an update statement that removes
event_id
from theaudit_log
table for entries whereevent_id
is linked with 'Map Generated' status in theevents
table.Removal of 'Map Generated' Events Any rows in the
events
table withnew_parcel_status
as 'Map Generated' have been deleted.Removal of 'Map Generated' Status Orders Similarly, entries from the
status_order
table are removed where theevent_name
is marked as 'Map Generated'.Status Order event_name Update If the
event_name
in thestatus_order
table was previously labeled as 'No Status', it has now been updated to an empty string ('') as the new value.Workflow Order Resetting for No Event Status The
workflow_order
for rows in thestatus_order
table where theevent_name
is an empty string ('') has been reset to have the value 0. This essentially prioritizes these rows at the base level in the workflow order.