Problems with South's migrations

6 views
Skip to first unread message

Mathieu Leduc-Hamel

unread,
Aug 18, 2010, 9:24:40 AM8/18/10
to satchmo-developers
Hi all,

I'm trying to use satchmo with south and it's a little bit complicated. Right now, when i try to migrate i have the following error:

 File "/Users/marrakis/Documents/lesite/zutano/Zutano/envs/downloads/satchmo/satchmo/apps/product/modules/subscription/migrations/0001_split.py", line 8, in forwards
    db.rename_table('product_subscriptionproduct', 'subscription_subscriptionproduct')
  File "/Users/marrakis/Documents/lesite/zutano/Zutano/envs/eggs/South-0.7.2-py2.6.egg/south/db/generic.py", line 227, in rename_table
    self.execute('ALTER TABLE %s RENAME TO %s;' % params)
  File "/Users/marrakis/Documents/lesite/zutano/Zutano/envs/eggs/South-0.7.2-py2.6.egg/south/db/generic.py", line 137, in execute
    cursor.execute(sql, params)
  File "/Users/marrakis/Documents/lesite/zutano/Zutano/envs/parts/django/django/db/backends/util.py", line 15, in execute
    return self.cursor.execute(sql, params)
  File "/Users/marrakis/Documents/lesite/zutano/Zutano/envs/parts/django/django/db/backends/sqlite3/base.py", line 200, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: no such table: product_subscriptionproduct

I don't understand, it seems the first migration of the subscription app doesn't migrate from initial state but from a previous version of Satchmo ?

Wouldn't be better to change the migration to make sure it work with an empty database ?

Mathieu Leduc-Hamel 

Alex Robbins

unread,
Aug 18, 2010, 9:58:10 AM8/18/10
to satchmo-d...@googlegroups.com
Yeah, this is a known issue. It is being worked on right now.
http://bitbucket.org/chris1610/satchmo/issue/1168/table-for-downloadlink-model-is-not-created-from-a-fresh

Until then, comment out south, syncdb, put south back in and fake the
migrations.

Alex

> --
> You received this message because you are subscribed to the Google Groups
> "Satchmo developers" group.
> To post to this group, send email to satchmo-d...@googlegroups.com.
> To unsubscribe from this group, send email to
> satchmo-develop...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/satchmo-developers?hl=en.
>

Mathieu Leduc-Hamel

unread,
Aug 18, 2010, 10:11:31 AM8/18/10
to satchmo-developers
Thanks Alex, I've just saw the discussion about the migrations, but as i reply in the thread of this issue, what's the current status? Is it planned to be able to start from clean db or you (the team) decided to use the Disable South; run syncdb; Enable South; run syncdb; fake migrations ?

Alex Robbins

unread,
Aug 18, 2010, 11:10:54 AM8/18/10
to satchmo-d...@googlegroups.com
You are supposed to be able to start from a clean db or the db at the
0.9 point. rctay is working on the fix in his branch. It is ready for
testing if you want to give it a try.

http://bitbucket.org/rctay/satchmo

Use at your own risk :)
Alex

Mathieu Leduc-Hamel

unread,
Aug 18, 2010, 11:12:53 AM8/18/10
to satchmo-developers
Cool !

I'll try it for sure. Not necessarily in production bot for sure on a test instance.

Is there any plan to merge it with the 0.9.2 branch soon ?

Alex Robbins

unread,
Aug 18, 2010, 12:45:56 PM8/18/10
to satchmo-d...@googlegroups.com
I think its just waiting on some testing, but rctay owns it, so he's
the person that decides when it is ready.
Alex

On Wed, Aug 18, 2010 at 10:12 AM, Mathieu Leduc-Hamel

Sebastien Fievet

unread,
Aug 19, 2010, 3:54:10 AM8/19/10
to Satchmo developers
Hi,
I have experienced some troubles with South migrations too, on another
project, not related to Satchmo.
But i learned something interesting about South - useful when syncing
a fresh database (so, when starting a new project) : instead of
comment South, then run syndb, then uncomment South, there is an easy
way : use --all with syncdb, then --fake to fake the migrations.
(http://south.aeracode.org/docs/commands.html#syncdb)
So, when running syncdb the first time, do the following :
$ python manage.py syncdb --all
$ python manage.py migrate --fake
All tables will be created with the last definition and migrations
will be up to date.
Hope it helps,
Sebastien

On Aug 18, 3:58 pm, Alex Robbins <alexander.j.robb...@gmail.com>
wrote:
> Yeah, this is a known issue. It is being worked on right now.http://bitbucket.org/chris1610/satchmo/issue/1168/table-for-downloadl...

Alex Robbins

unread,
Aug 19, 2010, 9:35:52 AM8/19/10
to satchmo-d...@googlegroups.com
Wow, I didn't know about that. Awesome tip!
Alex
Reply all
Reply to author
Forward
0 new messages