0

I am using Django 1.8. Whenever I make changes to models.py I have to make new migration file with python manage.py makemigrations.Then to reflect into DB by using python manage.py migrate.

Suppose I have added a null-able field to a model Product. Product contain more than a million record and its on live env. I know when I run `makemigrations` it will create a migration file.when I run migrate It will run `Alter Table` and it will lock Product table.

How can I add or alter field in models without downtime on live env?. Suggest a best way. Thanks a lot in advance.

Community
  • 1
  • 1
Himanshu dua
  • 2,496
  • 1
  • 20
  • 27
  • 1
    Alter table without locking the entire table http://stackoverflow.com/questions/35424543/alter-table-without-locking-the-entire-table – GrvTyagi Apr 14 '16 at 11:30
  • 1
    [Django migrations without downtime](http://pankrat.github.io/2015/django-migrations-without-downtimes/) – Paul Apr 14 '16 at 15:16

0 Answers0