ifnull
8/9/2014 - 5:20 AM

Django South migration example

Django South migration example

# Create migration script
./manage.py schemamigration clients --initial
./manage.py schemamigration clients add_email_format --auto

# Reset DB
dropdb django; createdb django;
mysql -uroot django < fixture-data-20140801.sql


# Migrate 
./manage.py dbshell
DELETE FROM south_migrationhistory; ALTER TABLE `clients_email` ADD COLUMN `email_format` varchar(200) NOT NULL DEFAULT 'hybrid'; quit;
./manage.py migrate --fake