Hi,

So the original problem was that I was running in the repo which didn't 
have the squashed migration. Django does know when to switch to the 
squashed migrations when you have both squashed and unsquashed migration 
files coexist in the folder.
As for the syntax error it was because python cannot import from modules 
that starts with numbers. Also, the idea was that we shouldn't use the 
migration files as modules to import code from, that's why the file name 
stayed as it was. Users should manually move their RunPython methods 
manually and resolve those invalid references to migration files.

Hope this helps and sorry for confusing people that squash migration 
doesn't work! I am still new to Python and Django and I really appreciate 
everyone's replies.

Cheers,
Cherie

On Monday, June 15, 2015 at 9:54:09 AM UTC+1, aRkadeFR wrote:
>
> Thanks for the good explanation as always :) 
>
>  From the documentation plus the explanation of the problem, 
> I wanted to know if by deleting the old migration it would still 
> run the old migrations. 
>
> Do we know the end of the story? Where it comes from? 
>
> Thanks 
>
> On 06/12/2015 05:42 PM, Carl Meyer wrote: 
> > On 06/12/2015 06:32 AM, aRkadeFR wrote: 
> >> You need to delete your old migrations so it uses only the squashed 
> >> one after. 
> > No, the squashed migration should be used in place of the old ones for 
> > any new database, even if the old ones are still present. This is the 
> > point of the squashmigrations feature; that you can keep the old ones 
> > around (which is necessary for any deployments that may not yet have 
> > applied all of them) while still gaining the benefit of the new squashed 
> > migration for new deployments (and tests). 
> > 
> > I know this works, because I just did it recently myself. It sounds like 
> > Cherie was able to get it working too, though we didn't get any 
> > clarification on why it didn't seem to work originally. 
> > 
> >> In the documentation: 
> >> "This enables you to squash and not mess up systems currently in 
> >> production that aren’t fully up-to-date yet. The recommended process is 
> >> to squash, keeping the old files, commit and release, wait until all 
> >> systems are upgraded with the new release (or if you’re a third-party 
> >> project, just ensure your users upgrade releases in order without 
> >> skipping any), and then remove the old files, commit and do a second 
> >> release." 
> > That's right. The length of time you need to wait before removing can 
> > vary widely. For a third-party app, it may be a full release cycle or 
> > two (as long as you can tell your users to upgrade version-by-version). 
> > For a project with only a few deployments, all under your control, it 
> > may be the same day. But regardless, the squashed migration will still 
> > be used in tests immediately, before you remove the old migrations. 
> > 
> > Carl 
> > 
>
> -- 
> aRkadeFR 
>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a46519d9-3819-40d5-8a18-236a4bec846e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to