MySQL Forums
Forum List  »  Newbie

Re: Delete parent fields or disable them?
Posted by: Phillip Ward
Date: December 08, 2014 07:00AM

Quote

... what happens if we delete an account that might have 25 account rates attached to it? I only see 2 options, either delete all those rates with the account being deleted or leave all the rates with no account name?
If we're talking about foreign key constraints here, then I almost always go with Option #3: Don't allow the account to be deleted! (IIRC, that's the "restrict" option).

If a process really, really wants to get rid of an account then it should do so from the "bottom up"; get rid of all the things that "hang off" the account, then trash the account itself.

However ...

If there's money involved, I would suggest that actually deleting accounts is not a Good Idea. Remember that Auditors can walk in at any time and demand to see what trade you've done, with any company, ever! Simply flagging the account as "deleted" might be a safer option (and removes any need to delete anything at all!).

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: Delete parent fields or disable them?
December 08, 2014 07:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.