Tag Info

New answers tagged

0

Following Neil and user16484 suggestions also ypercube and jynus and good practices at DB modeling, I come with this model This is what they talked about


1

No, that is not right. There should not be an order_id in a person table. Generally speaking, is an order id an attribute of a person? No. I'd start with Single Table Inheritance, as it's simpler: create table parties ( party_id int primary key, type smallint not null references party_types(party_type_id), --1=individual,2=organization name text not ...


2

This is an alternative to your solution. I suppose your id columns are just for mysql internal use, so you could have: person table with id, name, and type which would be a bit or 1 character to say if it is a natural or legal person. This table will connect to order table where you will only need one column - person_id On natural_person table you remove ...


5

To counter the points directly: Drupal doesn't use them and gets along fine without them, so why should we? Drupal supports many database layers, perhaps at least one of those does not support FKs and they chose to stick with the lowest common feature set? A great many people do use them, the one data point where people aren't using them is relatively ...


1

Removing foreign keys does not damage data because you are doing DDL to the indexes. Once you do that, data integrity (even for existing data) going down the road needs its integrity tested. EXAMPLE create table parent ( id int not null auto_increment, ... primary key (id) ); create table child ( id int not null auto_increment, fk_id ...


1

Actually I guess the answer is in your boss's words: 3.He's removed them from existing tables to change things and it's caused data corruption that was only noticeable weeks or months later, on high-traffic/ high activity sites, so he'd rather not use them. FKs removal does not change data, yet, if someone runs queries against the DB, like your boss did, ...


4

Implementing this stuff at an app level is a nightmare. You and your team will have to test, double check and retest code which does EXACTLY the same thing that's been done by MySQL (for InnoDB) for MILLIONS of users over a period of YEARS. Follow the discussion (one of the best threads I've seen on stackoverflow) here. With all due respect to you and your ...



Top 50 recent answers are included