Deleting records from referenced tables.
Posted: Wed Mar 19, 2014 3:31 pm
I'm new to relational databases & nuBuilder...
How do you handle the problem that occurs when a user deletes records from referenced tables?
Using the nuBuilder invoice example... If a user was to delete a product, then all of the existing customer_product records that references that product_id would not know what the product code,name, etc. from that related product record.
Even if the user was to re-create the same product it would have a different product_id and therefore not show up on any existing invoices.
The only way I can think of to fix this problem is to get the database administrator to create a product with the same product_id value that was used on the existing customer_product records.
To prevent this problem, would you not allow anyone the ability to delete records from referenced tables?
How do you handle the problem that occurs when a user deletes records from referenced tables?
Using the nuBuilder invoice example... If a user was to delete a product, then all of the existing customer_product records that references that product_id would not know what the product code,name, etc. from that related product record.
Even if the user was to re-create the same product it would have a different product_id and therefore not show up on any existing invoices.
The only way I can think of to fix this problem is to get the database administrator to create a product with the same product_id value that was used on the existing customer_product records.
To prevent this problem, would you not allow anyone the ability to delete records from referenced tables?