Topic: cannot delete from table service without cascade

Hi,
i have problem with my project,when i wanna delete service it does not allow me to delete.
Lets take example:
have many services/items to sell, i created orders and invoices for items that i sold but now i dont have anymore service1 in my shop to sell.
when i wanna delete that service i cannot.
is there any way to delete obsolete services but to stay in orders and invoices that are already created?
i know i can delete if i make cascade delete but then deletes all services from already created invoices or orders.
Thank you

Post's attachments

Attachment icon IGMAeng01062025_1927.zip 672.7 kb, 95 downloads since 2025-06-01 

Re: cannot delete from table service without cascade

I would suggest adding an 'expiry date' to your services table and then add a small script to check if any new orders try to use a service that has expired.
This means that old orders that were raised before the service expiry date will still be accessible.
See attached for a basic idea.
Derek.

Post's attachments

Attachment icon IGMAeng01062025_1927.zip 667.68 kb, 96 downloads since 2025-06-01