#34632: Let makemigrations output an error message with --check
-------------------------------------+-------------------------------------
     Reporter:  Jakob Probst         |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Migrations           |                  Version:  4.2
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Lukas von Allmen):

 We encountered the same issue as we used the command in our gitlab
 pipeline and relied on the output to inform the developer what went wrong.
 We solved it like this:

 {{{
 test:
   script:
     - ...
     - pipenv run python manage.py makemigrations --check || echo "Your
 models have changes that are not yet reflected in a migration. Run
 'manage.py makemigrations' to make new migrations, and then re-run
 'manage.py migrate' to apply them." && false
     - ...
 }}}

 But I guess it's a bit too specific for adding to the documentation.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34632#comment:5>
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/01070188e302262e-71c16db4-9a54-4a1a-882b-b7cda9c6c8fb-000000%40eu-central-1.amazonses.com.

Reply via email to