Migrations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Migrations

Matthew Pava

Does anyone else get a migraine when working migrations?

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/41f9ad6271964c208f3726a4fa28bfff%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

django-users mailing list
Nope.

-A

On Fri, Mar 10, 2017 at 12:17 PM, Matthew Pava <[hidden email]> wrote:

> Does anyone else get a migraine when working migrations?
>
> --
> 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 [hidden email].
> To post to this group, send email to [hidden email].
> 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/41f9ad6271964c208f3726a4fa28bfff%40ISS1.ISS.LOCAL.
> 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 [hidden email].
To post to this group, send email to [hidden email].
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/CAEE%2BrGoBUEDbn%2BcVx6nscnAhrh7b%2Bd22eMt33d69Ce3d1M77Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

Ed Sutherland-2
In reply to this post by Matthew Pava
I certainly do. After a serious migration foul-up, I restarted the project. I'm now hoping there won't be a repeat. I wish there was a better way.


---- On Fri, 10 Mar 2017 15:17:11 -0500 Matthew Pava <[hidden email]> wrote ----

Does anyone else get a migraine when working migrations?


--
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 [hidden email].
To post to this group, send email to [hidden email].
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 [hidden email].
To post to this group, send email to [hidden email].
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/15aba027491.b0f3915884552.3533620237900856580%40tburgnews.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

Dylan Reinhold
Relative to where django started, with you doing all the schema changes on your own. Migrations is AMAZING.  
Now db schema control is one of the harder problems to solve. Migration is not perfect, if you have ideas on how to make it better or know people who do, I'm sure Andrew and the django team would love to work work you on making it better.

I think a great thing that can be done is for people who have had issues with migration (or any software) to share and document what lead up to their issues.
Then 2 things happen the dev team has visibility into whats going wrong in the wild. And others can learn from those issues and try and avoid them.

Just my $0.02
Dylan

On Fri, Mar 10, 2017 at 12:56 PM, Ed Sutherland <[hidden email]> wrote:
I certainly do. After a serious migration foul-up, I restarted the project. I'm now hoping there won't be a repeat. I wish there was a better way.


---- On Fri, 10 Mar 2017 15:17:11 -0500 Matthew Pava <[hidden email]> wrote ----

Does anyone else get a migraine when working migrations?


--
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 [hidden email].
To post to this group, send email to [hidden email].
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 [hidden email].
To post to this group, send email to [hidden email].
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/15aba027491.b0f3915884552.3533620237900856580%40tburgnews.com.

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 [hidden email].
To post to this group, send email to [hidden email].
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/CAHtg44BixfEbgy0iL5cG%3DxngP9N4J_i-q3kGFW2ji5mPw59v7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

Mike Dewhirst-3
In reply to this post by Matthew Pava
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 [hidden email]
> <mailto:[hidden email]>.
> To post to this group, send email to [hidden email]
> <mailto:[hidden email]>.
> 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/41f9ad6271964c208f3726a4fa28bfff%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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

Vijay Khemlani
Not really, as long as you understand what's going on and not
inputting commands just for the sake of it.

On 3/11/17, Mike Dewhirst <[hidden email]> wrote:

> 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 [hidden email]
>> <mailto:[hidden email]>.
>> To post to this group, send email to [hidden email]
>> <mailto:[hidden email]>.
>> 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/41f9ad6271964c208f3726a4fa28bfff%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 [hidden email].
> To post to this group, send email to [hidden email].
> 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 [hidden email].
To post to this group, send email to [hidden email].
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/CALn3ei2iF2TgeuDHVmFKPZi0FmLt110PYeEAZbxa7Rp2%2B%2Bs4qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Migrations

Matthew Pava
In reply to this post by Mike Dewhirst-3
My problems this time around came from a circular dependency 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: [hidden email] [mailto:[hidden email]] On Behalf Of Mike Dewhirst
Sent: Saturday, March 11, 2017 1:23 AM
To: [hidden email]
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 [hidden email]
> <mailto:[hidden email]>.
> To post to this group, send email to [hidden email]
> <mailto:[hidden email]>.
> 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 [hidden email].
To post to this group, send email to [hidden email].
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 [hidden email].
To post to this group, send email to [hidden email].
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/c4ae90e54ab448b499fe046805937231%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

marcin.j.nowak
In reply to this post by Matthew Pava


On Friday, March 10, 2017 at 9:18:42 PM UTC+1, Matthew Pava wrote:

Does anyone else get a migraine when working migrations?


Yes*. Long time ago. Stayed with Liquibase wrapped with Liquimigrate.

Builtin migrations are pretty unrielable, because they're strongly dependent on your application's code. 
Create custom field, make migration, remove custom field - kaboom! Or something like that.

* - Not always. Builtin migrations are awesome, but for blog-like or short-maintainable projects. 
I'm using them for very small projects (blogs, homepages, etc) and they work well there.
These projects are rarely changed and I have no headache here. 

So the truth is - it depends. Think about maintaining the project and go with Liquibase (or something else) where long-term support is required.

Marcin

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/d0042e0e-27ee-4012-8f9e-14be43cd91d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

Mike Dewhirst-3
In reply to this post by Matthew Pava
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: [hidden email] [mailto:[hidden email]] On Behalf Of Mike Dewhirst
> Sent: Saturday, March 11, 2017 1:23 AM
> To: [hidden email]
> 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 [hidden email]
>> <mailto:[hidden email]>.
>> To post to this group, send email to [hidden email]
>> <mailto:[hidden email]>.
>> 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 [hidden email].
> To post to this group, send email to [hidden email].
> 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 [hidden email].
To post to this group, send email to [hidden email].
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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Migrations

Larry Martell
In reply to this post by Matthew Pava
On Fri, Mar 10, 2017 at 3:17 PM, Matthew Pava <[hidden email]> wrote:
> Does anyone else get a migraine when working migrations?

I have 2 django systems I support. The first has 2 deployments, both
in house, and one is generally a week or so behind the other. For this
system migrations generally work fine, however we do get situations
where they throw an error even though the migration seemed to work
(which I find disconcerting).

The second has 30 deployments, all out the field, all with different
versions of the code, and some without any external access. For these
we could not make migrations work for us and we do not use them.

Overall, I much preferred the old syncdb to create new tables, and I
managed the schema changes myself.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CACwCsY4LKa85ZZt1R18jJjF4dHXC61O7OHfGiKayy%3D9Z3XxEpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...