Interesting discussion - considering a situation here at my job just today/yesterday.
An email from a manager claiming that since this one employee is no longer with the co. (although the email was late since the guy left about 4 weeks ago) - was asking to have this User removed from these various systems. So - I responded yesterday that I had deleted the user record from this one system.
Then - this buddy of mine, another programmer here - he was out yesterday, so he asks me about the deletion of the record. He was worried that the deletion of the record would cause problems if there are FK constraints! I told him he need not worry - since for the most part in the system I did it - there really are mostly no FK's in there. Of course, I know there are a couple - but, nothing that would be impacted by the removal of a user from a table.
So - yes - I can relate.
-K-
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Wednesday, November 1, 2017 3:39 PM To: profoxtech@leafe.com Subject: Re: How many of you use foreign key constraints and References in your database schema?
On 2017-11-01 15:21, Bill Anderson wrote:
Mike,
Where's your preference in design with these in mind?<<
My philosophy is that the back end database, whatever it is, should be a dumb as a rock. A database should only be concerned with its internal integrity and no more. Anything else is pretty much geared toward vendor lock-in.
But having noted that, FK constraints are absolutely a part of the data integrity. So yes, use 'em.
Views? Sure, that's basically the only way to communicate. Business rules? Nope, stay away. That's for middleware.
Bill Anderson
Hi Bill!
I agree completely.
--Mike
[excessive quoting removed by server]