title: Django South Migration does not work the first time around
body: <p>I'm running a South migration <code>python manage.py syncdb; python manage.py migrate --all</code> which breaks when run on a fresh database. However, if you run it <em>twice</em>, it goes through fine! On the first try, I get </p>
  
  <pre><code>DoesNotExist: ContentType matching query does not exist. Lookup parameters were {'model': 'mymodel', 'app_label': 'myapp'}
  </code></pre>
  
  <p>After failure, I go into the database <code>select * from django_content_type</code> but sure enough it has  </p>
  
  <pre><code>13 | my model     | myapp      | mymodel  
  </code></pre>
  
  <p>Then I run the migration <code>python manage.py syncdb; python manage.py migrate --all</code> and it works!  </p>
  
  <p>So how did I manage to make a migration that only works the second time around? By the way <strong>this is a data migration</strong> which puts the proper groups into the admin app. The following method within the migration is breaking it:</p>
  
  <pre><code>@staticmethod
  def create_admin_group(orm, model_name, group_name):
      model_type = orm['contenttypes.ContentType'].objects.get(app_label='myapp', model=model_name.lower())
      permissions = orm['auth.Permission'].objects.filter(content_type=model_type)
      group = orm['auth.Group']()
      group.name = group_name
      group.save()
      group.permissions = permissions
      group.save()
  </code></pre>
  
  <p>(The migration files come from an existing working project which means a long time ago I had already run schemamigration --initial. I'm merely trying to replicate the database schema and initial data onto a new database.)</p>