I would like to ask if how do you deal with foreign keys?
Do you cascade delete, or just mark it as deleted but its there?
Here is my sample:
Users(table) 1 ------ * Transactions(Table that has userId) 1 | | * Items(table) 1 ------ * TransactionItems(Table That has ItemId)
(this scenario is for sales transactions )
Do if I delete a user that is being used in a transaction all transactions that have that user id will be deleted and that is not ok of course..
The simple answer might be to not allow the user of the application to delete a user record that is being referenced. So this means that you must not allow cascade delete right?
So, if I use cascade delete on the relationship between Transactions and TransactionItems would that be okay? Since its not being referenced.