Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I used to scare of it thinking why do I need it? everytime I delete sth it annoying me. I read blog post of GIthub not using FK key, and try to convince myself that FK isn't worth it.

One day, I decided let try this out. And turning out it wasy easiser than I think. When delete data just make sure to use cascade or ensure its associated data is deleted, which make sense.

Once I embrace it, FK now becomes my friend to enter data consistency, I cannot imagine how did I live without it before.



It’s can become pretty annoying if you want to alter your database schema.


How?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: