#32184: `manage.py migrate --noinput` should not delete stale modules
-------------------------------------+-------------------------------------
     Reporter:  uy-rrodriguez        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Core (Management     |                  Version:  2.2
  commands)                          |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  migrate, no-input,   |             Triage Stage:
  noinput, management                |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by uy-rrodriguez):

 Hi Carlton, as you say it definitely depends on the desired behaviour.

 My current use case is a software project with git branches for production
 (master), staging (test) and features. When new features are ready to be
 tested the staging branch is reset to master and the feature commits are
 merged into. From one "version" of the staging branch to another, the
 Django applications may change. I've identified the issue on this ticket
 when using `--no-input` in a new deployment of the staging branch where an
 app, not yet merged into master and so not existent in this new staging
 branch, was detected as stale and removed from the database. In this case
 we have lost the testing data stored by the staging branch that included
 such app. Of course, this is all test data and so it's not a big issue if
 it gets lost, we could also have a completely clean server each time a
 branch is deployed for testing, but that's not the point.

 Personally, I wasn't expecting Django to remove the stale elements and I
 think other people may encounter the same surprise.

 I think this ticket could be reopen at least to signal that the
 documentation could be updated to clarify how `migrate` behaves when
 `--no-input` is given.

 Replying to [comment:1 Carlton Gibson]:
 > Hi. Thanks for the report. I am going to say wontfix here initially, as
 it sounds to me like expected  behaviour.
 >
 > `migrate` synchronizes the database state with the current set of models
 and migrations — both adding and removing — and `--noinput` says ''Don't
 ask me for confirmation''. If you're in any doubt as to the exact
 operations that will be performed you should use `--plan` to verify
 beforehand.
 >
 > I hope that makes sense.
 >
 > However, if you want to follow up with an exact example (with a sample
 project preferably) of where an operation is performed that you think it
 should not be I am happy to look at that to double check here.
 >
 > Thanks again.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32184#comment:2>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.c3218f71b6a4a61cdb39cc009cc4b81e%40djangoproject.com.

Reply via email to