I'm +1 to doing *something.* Absent a louder reminder, I think it's
unrealistic to expect everyone to read the output of makemigrations all the
time.

As others have said, I'm not sure `manage.py migrate` is the right time. I
think it's too late. The code may have already been committed, who knows
what machine the migrations are being run on, etc.

During makemigrations, on the other hand, I don't see anything wrong with
formatted text or +/-, but I might go a step further. We already prompt for
things like renames and merges. Why not forcibly gain user acceptance
before creating a migration that deletes something? We could repeat the
reminder to double check it or allow the user to cancel the migration
altogether, for example:

"You are creating a migration that DELETES one or more columns or database
tables. As with any migration, if you continue, you should inspect the
created migration BEFORE running `manage.py migrate` to ensure it does what
you expect. Press Y to continue or N to cancel." (needs copyediting of
course)

It would be easy enough to bypass with --no-input if someone doesn't want
the interruption.

Cheers,


*Tobias McNulty*Chief Executive Officer

tob...@caktusgroup.com
www.caktusgroup.com


On Tue, Jun 16, 2020 at 2:30 AM Carlton Gibson <carlton.gib...@gmail.com>
wrote:

> Looking at the proposed ticket here #31700
> <https://code.djangoproject.com/ticket/31700>, I'm *Meh* at best:
>
> * - + ~
> * Green, yellow, red
>
> I'm not sure I want to look at either of those. Visual noise for X
> benefit, where I think X is likely very small.
> Not sure it's worth the complication.
>
> I'll close as needsinfo. If there's a lot of +1s here then we can reopen
> and accept.
>
> Thanks.
> C.
>
> On Friday, 12 June 2020 13:57:06 UTC+2, Tom Forbes wrote:
>>
>> However we could make the `makemigrations` output more noticeable if it
>> contains destructive operations? We could make the this line[1] output red
>> text on destructive operations, yellow on maybe destructive (like altering
>> a type), and green on safe operations?
>>
>> 1.
>> https://github.com/django/django/blob/master/django/core/management/commands/makemigrations.py#L216
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/91028857-8ef6-42cc-991c-3c092370341co%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/91028857-8ef6-42cc-991c-3c092370341co%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMGFDKQ8chsk0OVq9OVvx0BqspR7Phs8qePkSNW7V2oSXboZPQ%40mail.gmail.com.

Reply via email to