human-essentials
human-essentials copied to clipboard
Clean up old data -- Duplicate items in a Request
Summary
Clean up old data to validate against the item_requests_uniqueness_by_item_id Request validation.
Why?
So that if these records ever need to be modified they can be.
A user has an old request that they cannot discard because it fails the unique-item validation.
https://app.bugsnag.com/ruby-for-good/human-essentials/errors/6802b26bba22dd56911d0b81?filters[error.status]=open&filters[event.since]=30d
Details
For any Request with duplicate items, merge them together and sum the quantity. Put this into a database migration.
Other things to know/consider
- You'll have to fake this scenario in your dev database to test!
- Core team only so we can also validate against a production DB snapshot
Criteria for completion
- [ ] No Requests have duplicate items after the DB migration is run