News for hackers. Stuff that matters.
Re:Django zero-downtime migrations for Postgres that respect... by nicolasMLV on Tuesday October 23, 2018 @12:56PM (#18285136)
Rails uses foreign keys by default, usually I generate a migration file with `rails generate migration AddThisToThing this:references`

Then this line is generated `add_reference :things, :this, foreign_key: true`

and then we call the migration, and there is the foreign key.

Re:Django zero-downtime migrations for Postgres that respect... by orf on Tuesday October 23, 2018 @01:04PM (#18285203)
Is it not more accurate to say "by default rails generates migrations with the foreign key argument set to a non default value of true"?

By default the relationship constructors do not create foreign keys, if they did it would be redundant to include it in the generated output surely? At least that's what the docs seem to say.