title: Using south to migrate database table
body: <p>I was not using south. Now I want to add a couple columns. Am I screwed?</p>
  
  <pre><code>(env)noah:code broinjc$ ./manage.py schemamigration reports --initial
  Creating migrations directory at '/Users/broinjc/esp/code/reports/migrations'...
  Creating __init__.py in '/Users/broinjc/esp/code/reports/migrations'...
   + Added model reports.Classroom
   + Added model reports.Student
   + Added model reports.SurveySet
   + Added model reports.Survey
  Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate reports
  (env)noah:code broinjc$ ./manage.py migrate reports
  Running migrations for reports:
   - Migrating forwards to 0001_initial.
   &gt; reports:0001_initial
  FATAL ERROR - The following SQL query failed: CREATE TABLE "reports_classroom" ("id" integer NOT NULL PRIMARY KEY, "user_id" integer NOT NULL, "added" datetime NOT NULL, "updated" datetime NOT NULL, "name" varchar(30) NOT NULL, "am_or_pm" varchar(2) NOT NULL)
  The error was: table "reports_classroom" already exists
   ! Error found during real run of migration! Aborting.
  
   ! Since you have a database that does not support running
   ! schema-altering statements in transactions, we have had 
   ! to leave it in an interim state between migrations.
  
  ! You *might* be able to recover with:   = DROP TABLE "reports_classroom"; []
     = DROP TABLE "reports_student"; []
     = DROP TABLE "reports_surveyset"; []
     = DROP TABLE "reports_survey"; []
  
   ! The South developers regret this has happened, and would
   ! like to gently persuade you to consider a slightly
   ! easier-to-deal-with DBMS (one that supports DDL transactions)
   ! NOTE: The error which caused the migration to fail is further up.
  Error in migration: reports:0001_initial
  </code></pre>
  
  <p>After seeing all that, I thought, maybe I need to update my models (making them inconsistent with sqlite db) So I updated them and then ran the same command but with --auto instead of initial...</p>
  
  <pre><code>(env)noah:code broinjc$ ./manage.py schemamigration reports --auto
   ? The field 'SurveySet.top_num' does not have a default specified, yet is NOT NULL.
   ? Since you are adding this field, you MUST specify a default
   ? value to use for existing rows. Would you like to:
   ?  1. Quit now, and add a default to the field in models.py
   ?  2. Specify a one-off value to use for existing columns now
  </code></pre>
  
  <p>... So I went ahead with option 2, and then proceeded to migrate...</p>
  
  <pre><code>(env)noah:code broinjc$ ./manage.py migrate reports
  Running migrations for reports:
   - Migrating forwards to 0002_auto__add_field_surveyset_top_num__add_field_surveyset_externalizer_ra.
   &gt; reports:0001_initial
  
  FATAL ERROR - The following SQL query failed: CREATE TABLE "reports_classroom" ("id" integer NOT NULL PRIMARY KEY, "user_id" integer NOT NULL, "added" datetime NOT NULL, "updated" datetime NOT NULL, "name" varchar(30) NOT NULL, "am_or_pm" varchar(2) NOT NULL)
  The error was: table "reports_classroom" already exists
   ! Error found during real run of migration! Aborting.
  
  
   ! Since you have a database that does not support running
   ! schema-altering statements in transactions, we have had 
   ! to leave it in an interim state between migrations.
  
  ! You *might* be able to recover with:   = DROP TABLE "reports_classroom"; []
     = DROP TABLE "reports_student"; []
     = DROP TABLE "reports_surveyset"; []
     = DROP TABLE "reports_survey"; []
  </code></pre>