3

I never set foreign keys in development in case I need to wipe or truncate stuff. Fuck you sql

Comments
  • 0
    Am I the only who never uses foreign keys in production?
  • 1
    @PoweredByCoffee depends, on small scale they don't matter on bigger scales it seriously speeds up
  • 0
    Aha! I set foreign keys in development and there's nothing you can do to stop me!

    (I do end up screwing myself into large migrations though... curse my OCD)
  • 0
    By creating the column "foo_id" and writing a separat migration to set fks in production.
  • 0
    @ironedr i don't know about Common practice, it's just my lazy approach. Try to truncate or delete a table with fks and mysql throws you an error message if data is present . Since it's my dev env there sometimes is the need to wipe everything or wipe a certain table
  • 0
    Event Sourcing ftw
Add Comment