#28832: django migrations to PostgreSQL not handling order_with_respect_to 
removals
-------------------------------------+-------------------------------------
     Reporter:  AJ                   |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Migrations           |                  Version:  1.11
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
  order_with_respect_to PostgreSQL   |  Unreviewed
  makemigrations                     |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

 Is it possible that you encountered the PostgreSQL constraint violation
 for the short period of time where your new code that removed the
 `order_with_respect_to` was deployed to your web workers while you had not
 run your migration that removed the `_order` column?

 The only way to achieve zero-downtime for this kind of operation would be
 to perform the following manipulations:

 1. Run a migration that makes `_order` nullable.
 2. Deploy the code removing the `order_with_respect_to` to your workers.
 3. Run a migration that drops the `_order` column.

 It's really not different from the manipulations required for removing a
 normal non-nullable field. The `AlterOrderWithRespectTo` operation is
 harder to reason about because it doesn't make it clear it's implemented
 using an hidden `_order` field that requires the same care.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28832#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.63b79f38e68023f540540bc4499cd9bb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to