Open medihack opened 1 month ago
If we document it, I think it makes more sense to document it as a migration and let people factor it differently if relevant for them. For the vast majority of people, the relevant thing to do will be to create a migration.
Also, if you create the FK (or o2o) with db_constraint=False
, you don't even need to remove the constraint.
BTW, here's how Django generates the constraint name
If we document it, I think it makes more sense to document it as a migration and let people factor it differently if relevant for them. For the vast majority of people, the relevant thing to do will be to create a migration.
Sure, it was only so that I don't have to look up the SQL later 😉.
Also, if you create the FK (or o2o) with
db_constraint=False
, you don't even need to remove the constraint.
Thanks, good to know!
When creating a relation from another Django model to the
ProcrastinateJob
model like thisI get an error when jobs are deleted from the database (e.g., by
app.run_worker(delete_jobs="always")
). This is because Django sets theon_delete
trigger only at the application level but not at the database level.I solved it by altering my table itself with some custom migration. I even created a function for that
I think we should add a note to the documentation (for example, in the FAQ).