alf.io icon indicating copy to clipboard operation
alf.io copied to clipboard

check special_price table: ticket_category_id is not a FK, check why and how to cleanup

Open syjer opened this issue 7 years ago • 1 comments

in the context of the issue #469 , we have added an additional column organization_id_fk so we can easily enforce a row policy.

In some cases, the organization_id_fk is derived from the data and set from a trigger.

The table special_price is currently the only one where - due to the fact that we are missing a FK constraint - it's possible that the organization id cannot be derived as the ticket_category_id may not exist anymore.

Check why and how we can cleanup.

If we can simply remove safely the orphaned data and re-enable the not null check: it may be the best outcome.

syjer avatar Jan 09 '19 21:01 syjer

Hi @syjer, I would like to work on the above enhancement. Please assign it to me.

ved-asole avatar Sep 14 '23 05:09 ved-asole