Migrations index doubling

14 views
Skip to first unread message

Andrew Pashkin

unread,
May 27, 2014, 6:07:29 AM5/27/14
to south...@googlegroups.com
Sometimes, merges in VCS may cause such situation, when for one application two migrations have same index, like:

    0028_migration_x_from_branch_a
    0028_migration_y_from_branch_b


Is it normal situation, or I should correct one of the indexes, to make them sequential?

Andrew Godwin

unread,
May 27, 2014, 3:24:00 PM5/27/14
to south...@googlegroups.com
Hi Andrew,


Basically, if the two migrations touch different things, it's fine, but you'll still need to make an empty migration afterwards to have the autodetector work properly. The upcoming Django migrations, on the other hand, are better at merges and don't need the extra migration.

Andrew


--
You received this message because you are subscribed to the Google Groups "South Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to south-users...@googlegroups.com.
To post to this group, send email to south...@googlegroups.com.
Visit this group at http://groups.google.com/group/south-users.
For more options, visit https://groups.google.com/d/optout.

Andrew Pashkin

unread,
May 28, 2014, 2:52:40 AM5/28/14
to south...@googlegroups.com
Hi! Thanks for the response.

I've read the docs, but I don't fully understood it. Now I get it - the whole reason for empty migration is in freezing ORM properly and making South detect new changes correctly.
-- 
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - andrew....@gmx.co.uk

Andrew Pashkin

unread,
Jun 4, 2014, 12:37:37 PM6/4/14
to south...@googlegroups.com
How to revert doubled migrations? =)
Say, I have this:
0028_a
0028_b
0029_a
0029_b

And migrations b comes from branch B and a from A. So I need to revert b migrations, how to do that?

Andrew Pashkin

unread,
Jun 4, 2014, 1:21:05 PM6/4/14
to south...@googlegroups.com
I've solved this by deleting migrations that need to be preserved from migrations history in DB, then migrating backwards and then restoring records from migrations history in DB.

But thats kind of hacky, in a bad meaning.

Martin Maney

unread,
Jun 4, 2014, 8:26:47 PM6/4/14
to south...@googlegroups.com
On Wed, Jun 04, 2014 at 09:21:02PM +0400, Andrew Pashkin wrote:
> I've solved this by deleting migrations that need to be preserved
> from migrations history in DB, then migrating backwards and then
> restoring records from migrations history in DB.
>
> But thats kind of hacky, in a bad meaning.

Uhm, yeah. Guess it would work, but...

> On 04.06.2014 20:37, Andrew Pashkin wrote:
> >How to revert doubled migrations? =)
> >Say, I have this:
> >
> > 0028_a
> > 0028_b
> > 0029_a
> > 0029_b
> >
> >And migrations b comes from branch B and a from A.So I need to
> >revert b migrations, how to do that?

migrate (back) to 0028_a, remove the b migration files, migrate
forwards (to 0029_a). Assuming 0029_a works both forwards and
backwards and doesn't lose information. :-/

--
Not on the wealthy, who buy only what they want when they want it, was
the vast superstructure of industry founded and built up, but on those who,
aching for a luxury beyond their reach and for a leisure forever denied them,
could be bullied or wheedled into spending their few hardly won shillings
on whatever might give them, if only for a moment, a leisured and
luxurious illusion. -- Dorothy Sayers, _Murder Must Advertise_

Andrew Pashkin

unread,
Jun 5, 2014, 2:44:18 AM6/5/14
to south...@googlegroups.com

On 05.06.2014 04:26, Martin Maney wrote:
> and doesn't lose information. :-/
Well, in my case it doesn't, but oftenly it does - columns drops for
example.
Reply all
Reply to author
Forward
0 new messages