I think *makemigrations* should never be used in production. You run it
locally and then commit the migrations.

If it's a new production server you are deploying, I think you can delete
all your migrations and then run *makemigrations* (locally) to create only
initial migrations. But only if you are sure you're not going to need to go
back to a previous migration version. But if it's not a new production
server, just run *migrate* there after you commit your migrations locally
and pull them from the server.

Take a look at
https://github.com/speedy-net/speedy-net/blob/master/contrib/deploy.sh
אורי
u...@speedy.net


On Tue, Apr 2, 2019 at 3:51 PM Simon A <arriolasi...@gmail.com> wrote:

> There is a workflow section in the migration page from the django project
> documentation. But there are somethings I am confused about,
>
> It says that the migrations need to be created in the non production
> environment and then checked in to the repository along with the changes in
> models.py.
>
> My question is how would that migration be applied in the production
> environment.
>
> Once the new migrations and changes in the model are deployed in the
> server, should I execute *python manage.py migrate* in the server?
>
> Or is it also acceptable to just deploy the changes in production
> environment, then execute *makemigrations* and *migrate* in production?
>
> FYI, our deployment process is still a bit manual. There is a different
> person handling the production servers so I'd still have to document the
> deployment steps and endorse to the sysadmins that will perform the change
> in the server.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/35d6d27e-6210-4c8c-b31c-2adb424b9773%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/35d6d27e-6210-4c8c-b31c-2adb424b9773%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABD5YeFBGELGkraumsS3yfs9TxZrmfVGVb9wkJcaMBKpzrHCHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to