Hi, all! Curious about how folks do data migrations as we ran into an issue
recently:

Our production deployment consists of three containers running the
application. When each container comes up it runs a series of startup tasks
include `./manage.py migrate`. Usually it's fine to run this whenever
because it's idempotent and Postgres should reject simultaneous schema
changes.

So I was surprised recently when we performed a deploy that included a data
migration that created some objects and it created the objects multiple
times. I'm assuming what happened is that the containers each kicked off a
migration command simultaneously (thus all three containers saw that the
migration hadn't been run yet) and Postgres didn't block any of the
transactions as conflicting.

How do you all avoid this?

Thanks!
Harris

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKrvLbaOG_RztdT%2BHOZO%2BJdw8HPcGQtdLk%2B2wLsfZrvP%2ByHVdw%40mail.gmail.com.

Reply via email to