Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
metamourge868690dForeign keys are used to enforce certain data-integrity rules.
Eg, every Post is linked to a user by their UID.
But what if the user removes their account?
Without a foreign key, you'd now have a post with a dangling reference to a user that doesn't exist anymore.
However, if you set post.userid as a foreign key to users.id the DB can autoremove/correct the post entry.
Also, noone can fuck with the DB and create a Post without a valid userid.
netikras2294590dTry messing around with Liferay's database. You'll understand WHY very quickly.
No integrity, no protection from removing data required to other entities, no data map at all. By looking at such databases w/o relations I cannot tell how tf are portletitem and layout tables related. I know they are, but no idea how. Can I update portletitem safely? Can I update layouts w/o killing portlets... ? Who's to say...