Exactly!  I need to know if we will *run* migrations.

On Thursday, March 26, 2020 at 2:59:39 AM UTC-4, Fran Hrženjak wrote:
>
> If I’m understanding correctly, the difference between `makemigrations 
> --check` and your use case is that one checks if we need to *create* any 
> migrations while the other checks (or would check) if we need to *run* any 
> migrations.
>
> Seems reasonable to me. Although I would prefer we just add a `--check` 
> option to the existing `migrate` command to keep it simpler and consistent 
> with the existing option for `makemigrations` command. 
>
>  
>
> On Thu, 26 Mar 2020 at 07:29, Gordon <wgor...@gmail.com <javascript:>> 
> wrote:
>
>> Good morning.
>>
>> I had created ticket https://code.djangoproject.com/ticket/31402 after 
>> discussing in IRC about a built in way to stop a continuous delivery 
>> pipeline if the deployment would need to run database migrations. (i.e. if 
>> running `python manage.py migration` would do anything or not.
>>
>> In my specific scenario, I would like to run `python manage.py 
>> showmigrations --database=foo --check` and have it fail if there are 
>> unapplied migrations to the 'foo' database (or the default database as the 
>> case may be).  In this case, the automatic deployment would halt to prevent 
>> downtime.
>>
>> The discussion resulted with one must parse the results from `python 
>> manage.py showmigrations`.  I.e. write a script that checks the output of 
>> `showmigrations` for something like '[ ]'.
>>
>> I can certainly do that, but it seems like it would be generally useful 
>> to have this type of command available within Django.  It could be used to 
>> improve the release process for any project that uses some sort of 
>> automatic deployment scenario.
>>
>> The ticket was rejected with the response, use `python manage.py 
>> makemigrations --check`.  However, I believe that this command determines 
>> if the current version of models on disk would result in a new migration 
>> being made.  This is not the same as the functionality I have suggested.  
>> Am I wrong here?
>>
>> Please let me know your thoughts.
>>
>> -- 
>> 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-d...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/728bde3f-e68c-4224-9101-5c98a45c1016%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-developers/728bde3f-e68c-4224-9101-5c98a45c1016%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> -- 
> LP,
> Fran
>
>

-- 
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/b9e04f84-2dd7-4fd7-96a8-35d3a87aea12%40googlegroups.com.

Reply via email to