Search code examples
djangodjango-south

Is there a way to configure South to migrate without asking any questions?


I'm using Django South for managing my database schema updates. As I'm currently developing locally, my models are changing a lot, and it's really annoying to change things with South:

$ bin/django schemamigration --auto core
(Please provide a default value for new field...)
...
$ bin/django migrate core

It often takes forever to do simple things like add and remove columns from the database, as South prompts me to provide default values even for columns I'm deleting.

Is there a setting that will cause South to work much more like Hibernates hibernate.hbm2ddl.auto setting and automatically, promptlessly, awesomely update my database schema without any fuss? Is there an alternative library for doing this?

South is really important to me for deployment migrations, but I need something to help me change things fast as I'm rapidly prototyping things.


Solution

  • I use fabric to help with local and production changes. This is a function in my fabfile.py. It helps with any changes I want to make.

    def run_local():
    """
    Installs requirements, syncs the database, migrates with south, and runs the server.
    """
    local('pip install -r conf/requirements.txt')
    local('python manage.py syncdb')
    local('python manage.py migrate')
    local('python manage.py runserver')