Keeping referential integrity

admin

Administrator
Staff member
I would like to keep a reference between 2 tables (E.g. Orders and Products), and orders_items table keeps record of the items per order.

I have a problem with keeping referential integrity between orders and products which may be obsolete and therefore need to be removed from the table.

The only 2 solutions I can think of it to mark each product as is_available enum('Y','N') and display if letter is 'Y', or store a copy of all products ever stocked and keep a reference to that table.

Can anyone help (or even understand this drivel?)

Thanks,
Ori
 
Back
Top