alf.io
alf.io copied to clipboard
check special_price table: ticket_category_id is not a FK, check why and how to cleanup
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.
Hi @syjer, I would like to work on the above enhancement. Please assign it to me.