Keep the foreign key constraint using soft delete I have a product table and it is foreign key for product ingredients table.
Is there a way to check if it is fk referenced before making isdeleted = true without manually querying for it?
You could require the UPDATE to reference a subquery that will return no results if references exist. Then, if 0 rows are updated, you can raise a message to the UI to report an error.