Hi Timothy,
Assuming as an example that 0002_<>.py is the migration that you have already applied to production server, this is the scheme I follow:
- Make sure you have your local db up to date i.e. all the model changes have been applied to database.
- Fake a reversal to the last migration already applied to prod. In this case: manage.py migrate --fake <app_name> 0002
- delete all the migration files after 0002
- run makemigrations: manage.py makemigrations
- Fake application of the new single migration: manage.py migrate --fake <app>
Now you have a single migration representing all the db changes since the last deploy. Hope this helps.
Regards,
Abhaya
On Sat, Apr 25, 2015 at 5:56 PM, Timothy W. Cook <tim@mlhim.org> wrote:
--Django 1.8 Python 3.4 PostgreSQL 9.3During development I am creating several migrations. It seems unnecessary to keep these since they only exist on my dev machine.Any data that I have created can be thrown away too.Is it safe to delete these migrations (and the database) before deploying to the next stage for testing by users?--
============================================
Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecookMLHIM http://www.mlhim.org
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WNb8XWUWLyN%2B7fq4u7Er3dczOqgBKLODdVnE3cLxOr-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
-------------------------------------------------
blog: http://abhaga.blogspot.com
Twitter: http://twitter.com/abhaga
-------------------------------------------------
blog: http://abhaga.blogspot.com
Twitter: http://twitter.com/abhaga
-------------------------------------------------
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFPF63R4xJ1%3DZdJ7y2Y5SO8JUy7tTwmdmBk1%3DWNVSJ6zrBpb9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment