openequella / openEQUELLA

Core openEQUELLA sources
https://openequella.github.io/
Apache License 2.0
42 stars 44 forks source link

Create new unique constraint on Attachment database table #1456

Closed mrblippy closed 4 years ago

mrblippy commented 4 years ago

Describe the bug A client ran into an issue while using the EBI(uses the soap api), which caused attachments being created in an item with duplicate attachment uuids. This in turn can cause issues with other tools used with oEQ. eg, edalex reporting db tool

This highlights the need to a new constraint to be put on the attachment table to prevent this from happening.

It would need to be a compound constraint, comprised of uuid and item_id columns.

A data migration may also be required to fix any items which already contain attachments with duplicate uuids. But that may be easier said than done

To Reproduce Steps to reproduce the behavior:

These steps to reproduce are not what you would call a real world case, but should be suitable for testing and dev purposes

  1. Create and publish item with multiple attachments
  2. Locate the attachments in the attachment table
  3. Alter the uuid columns so both entries have the same uuid
  4. You will be able to save the entry.

Expected behavior A constraint violation should be caused when an multiple attachments in the same item contain the same uuid

Platform:

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

edalex-ian commented 4 years ago

Hey @mrblippy , was @cathfitz waiting for you to add more info here?

mrblippy commented 4 years ago

This issue is no longer required. It turned out to be some rogue save scripting that was tripping up the ebi