Comment (by David Sanders):
One more thing:
`--update` is a destructive operation – if you had any customised
migration operations or code in your latest migration this will be
permanently deleted if you run update *without any warning*.
I'd like to suggest that *at least* one of the following happen:
1. `--update` does a confirmation eg
"<app>/migrations/0009_last_migration.py will be replaced. Proceed? y/N".
Along with this we provide a `--no-input`. Both of these are consistent
with other commands.
2. we document that it destroys your last migration without warning
My preference is 1. because, to paraphrase FunkyBob, the purpose of any
framework is to manage the risky and the tedious.
We should at the very least do 2. if it's decided 1. is a no-go.
This also sounds like another ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/34568#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Mariusz Felisiak
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34568#comment:12>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/16865 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/34568#comment:13>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c52f4295f254e1c14af769d22b1a5f516a941f58" c52f429]:
{{{
#!CommitTicketReference repository=""
revision="c52f4295f254e1c14af769d22b1a5f516a941f58"
Fixed #34568 -- Made makemigrations --update respect --name option.
Thanks David Sanders for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34568#comment:14>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"cdd970ae22303e6c58b5c1f3ba695c470a811b56" cdd970ae]:
{{{
#!CommitTicketReference repository=""
revision="cdd970ae22303e6c58b5c1f3ba695c470a811b56"
[4.2.x] Fixed #34568 -- Made makemigrations --update respect --name
option.
Thanks David Sanders for the report.
Backport of c52f4295f254e1c14af769d22b1a5f516a941f58 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34568#comment:15>
Comment (by Natalia Bidart):
Replying to [comment:11 David Sanders]:
> One more thing:
>
> `--update` is a destructive operation – if you had any customised
migration operations or code in your latest migration this will be
permanently deleted if you run update *without any warning*.
>
> I'd like to suggest that *at least* one of the following happen:
>
> 1. `--update` does a confirmation eg
"<app>/migrations/0009_last_migration.py will be replaced. Proceed? y/N".
Along with this we provide a `--no-input`. Both of these are consistent
with other commands.
> 2. we document that it destroys your last migration without warning
>
> My preference is 1. because, to paraphrase FunkyBob, the purpose of any
framework is to manage the risky and the tedious.
>
> We should at the very least do 2. if it's decided 1. is a no-go.
>
> This also sounds like another ticket.
I agree this should be another ticket, and I also agree overwriting
without any warning feels like an antipattern. I would definitely go with
(1).
Having said the above, are you positive overwrites are happening? If so,
could you please provide the sequence of commands that would trigger that
situation in the new ticket? Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/34568#comment:16>