Skip to content

Clean up old data -- Duplicate items in a Request #5276

@awwaiid

Description

@awwaiid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    core teamGroomed but likely needs expert knowledge

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions