South doesn't run custom initial sql on migration

318 views
Skip to first unread message

Edwin

unread,
Jan 6, 2011, 3:49:57 PM1/6/11
to South Users
Hi,

When I run south migration, my initial sql data is not executed
(running v0.7). Ideally, I would want to have all my tables created
first during the migration, then insert some initial data using a sql
file. Upon looking at south's source code, I don't see if south is
actually running initial sql like what Django's syncdb does. Is this
actually supported in South? If it doesn't, when will it be supported?
If it won't be supported, why?

My current solution is to listen to post_migrate signal and define a
handler that manually installs initial SQL file if it finds any in the
current app. However, this method is not very clean in my opinion..


Thanks for your help.

Andrew Godwin

unread,
Jan 6, 2011, 6:03:31 PM1/6/11
to south...@googlegroups.com

South doesn't run the initial/custom SQL, because it doesn't really fit
in the migration flow. If you want to run it, I'd suggest making an
empty schemamigration (./manage.py schemamigration --empty initial_sql)
and then putting the SQL in a db.execute_many call.

Andrew

Reply all
Reply to author
Forward
0 new messages