On 14/03/2017 12:25 AM, Matthew Pava wrote:
My problems this time around came from a circular dependency

I have encountered that but I blame myself for asking too much of migrations. I have renamed a model and table successfully using migrations and I believe that led to the circular dependency when I tried to squash.

My project is SaaS in nature so I have control of all instances of the database. My plan is to choose a moment in time when the entrails indicate good fortune awaits the bold and I'll delete *all* migrations except for the Django ones and remove the records from the django_migrations table and do a fake initial migration.

Naturally I'll prepare well with a brute-force recovery in mind and ... I have never believed I would ever want to roll my project back to a previous incarnation so losing all the migrations is a price I'm prepared to pay.

Cheers

Mike

that squashmigrations caused.  I have had issues in the past with removing a 
field from a model and basically having a simple pass statement for the model.  
I saw a ticket or some discussion somewhere about that issue elsewhere.  I also 
have had issues when renaming models, especially since the apps in my project 
are so interdependent on each other.  But I already saw a ticket for part of 
that issue that is currently unresolved.  It is related to using a string to 
relate a ForeignKey instead of the model object itself.  The other aspect of 
that issue was that the makemigrations commands added so many unnecessary 
operations that just caused the migrate command to break.  And after applying 
the new migrations to the production code, it works fine until I apply the 
migrations again, stating that it can't find the field that I already renamed.

I apologize for my earlier generalization, but, as you can see, I have had a 
struggle with migrations in general, and I have generally tried to let Django 
do the work in generating them.

-----Original Message-----
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Mike Dewhirst
Sent: Saturday, March 11, 2017 1:23 AM
To: django-users@googlegroups.com
Subject: Re: Migrations

On 11/03/2017 7:17 AM, Matthew Pava wrote:
Does anyone else get a migraine when working migrations?

Only when I try to game them. If I follow instructions they are magnificent. 
That said, what are your problems?

Mike


--
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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto: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/41f9ad6271964c208f3726a
4fa28bfff%40ISS1.ISS.LOCAL
<https://groups.google.com/d/msgid/django-users/41f9ad6271964c208f3726a4fa28bfff%40ISS1.ISS.LOCAL?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/8e23d94f-696c-91b4-af71-0418d047cd80%40dewhirst.com.au.
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/82ef7ac6-9f39-2b9c-1acd-46fdb6aa3032%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Reply via email to