My solution to this problem was by adding more migrations steps:
1. Step to make the field nullable.
2. Backward step to fill value to the removed field.
3. Step to remove the field.

Regards,

Aldian Fazrihady


On Thu, 20 Jun 2019, 19:37 Matthieu Rudelle, <m.rude...@artmyn.com> wrote:

> Hi there!
>
> I am about to file a feature request but I figured this might have been
> discussed (although I can't find where).
>
> The use case is when removing fields in a production environment. We run
> our django migrations without downtimes, such that basically, from time to
> time we have an old release working on an DB migrated by the new release.
>
> And when we remove a field it breaks. So we're thinking there should be a
> way to flag a field as "disabled", its value will not be requested on the
> DB and default to a hardcoded value. No migration should remove the column
> yet. Once the field is actually removed the column can be safely removed
> without breaking the old version.
>
> What do you guys think? Is there a better way to solve this?
>
> *Note: a slightly different usecase that it could solve, the third item on
> this wishlist: *
> https://pankrat.github.io/2015/django-migrations-without-downtimes/#django-wishlist
>
> Best,
> Matthieu
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANP1NSx%3DRu63c2vR4R%3DfbtBEHV3WRqf1XxWtN%3Dd23j3VoA-ZZw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANP1NSx%3DRu63c2vR4R%3DfbtBEHV3WRqf1XxWtN%3Dd23j3VoA-ZZw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN7EoAYOPbQ-BA8e5Qekyuhr7cc4ueqgz-ihmmC9VdoGkwC0Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to