title: Django 1.7 Migration error with Heroku Postgres
body: <p>I am using python 3.3.4 and Django 1.7 to deploy an app to Heroku with Heroku Postgresql. My app is working fine locally using sqlite.
  When I run the command for the initial migration:</p>
  
  <pre><code>heroku run python manage.py
  </code></pre>
  
  <p>I get a migration error:</p>
  
  <pre><code>(storage_project)Edu222-Macbook-Pro:storage educalvachi$ heroku run python manage.py migrate
  Running `python manage.py migrate` attached to terminal... up, run.9874
  Operations to perform:
    Synchronize unmigrated apps: django_admin_bootstrapped
    Apply all migrations: contenttypes, core, admin, sessions, auth
  Synchronizing apps without migrations:
    Creating tables...
    Installing custom SQL...
    Installing indexes...
  Running migrations:
    Applying contenttypes.0001_initial... OK
    Applying auth.0001_initial... OK
    Applying admin.0001_initial... OK
    Applying core.0001_initial... OK
    Applying core.0002_auto_20140530_0152... OK
    Applying core.0003_auto_20140819_1955... OK
    Applying core.0004_auto_20140822_1426... OK
    Applying core.0005_auto_20140822_1908... OK
    Applying core.0006_auto_20140824_0021...Traceback (most recent call last):
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/backends/utils.py", line 65, in execute
  return self.cursor.execute(sql, params)
  psycopg2.ProgrammingError: multiple primary keys for table "core_broca" are not allowed
  
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "manage.py", line 10, in &lt;module&gt;
  execute_from_command_line(sys.argv)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
  utility.execute()
    File "/app/.heroku/python/lib/python3.3/site-packages/django/core/management/__init__.py", line 377, in execute
  self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/core/management/base.py", line 288, in run_from_argv
  self.execute(*args, **options.__dict__)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/core/management/base.py", line 338, in execute
  output = self.handle(*args, **options)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/core/management/commands/migrate.py", line 160, in handle
  executor.migrate(targets, plan, fake=options.get("fake", False))
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/migrations/executor.py", line 63, in migrate
  self.apply_migration(migration, fake=fake)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/migrations/executor.py", line 97, in apply_migration
  migration.apply(project_state, schema_editor)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/migrations/migration.py", line 107, in apply
  operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/migrations/operations/fields.py", line 37, in database_forwards
  field,
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/backends/schema.py", line 411, in add_field
  self.execute(sql, params)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/backends/schema.py", line 98, in execute
  cursor.execute(sql, params)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/backends/utils.py", line 81, in execute
  return super(CursorDebugWrapper, self).execute(sql, params)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/backends/utils.py", line 65, in execute
  return self.cursor.execute(sql, params)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/utils.py", line 94, in __exit__
  six.reraise(dj_exc_type, dj_exc_value, traceback)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/utils/six.py", line 549, in reraise
  raise value.with_traceback(tb)
    File "/app/.heroku/python/lib/python3.3/site-packages/django/db/backends/utils.py", line 65, in execute
  return self.cursor.execute(sql, params)
  django.db.utils.ProgrammingError: multiple primary keys for table "core_broca" are not allowed
  </code></pre>
  
  <p>My models file for this app looks like this:</p>
  
  <pre><code>from django.db import models
  
  class Persona(models.Model):
      identificacion = models.CharField(max_length=20)
      name = models.CharField(max_length=164)
  
      def __str__(self):
          return self.name
  
  class Herramienta(models.Model):
      marca = models.CharField(max_length=90)
      tipo = models.CharField(max_length=90, blank=True)
      codigo_id = models.CharField(max_length=15, unique=True)
      prestamos = models.ManyToManyField(Persona, through='Prestamo')
  
      def __str__(self):
          return self.marca + " " + self.tipo + " " + self.codigo_id
  
  class Prestamo(models.Model):
      herramienta = models.ForeignKey(Herramienta)
      persona = models.ForeignKey(Persona)
      fecha_prestamo = models.DateTimeField(auto_now_add=True)
      fecha_devolucion = models.DateTimeField(null=True, blank=True)
  
      def __str__(self):
          return "Préstamo a " + self.persona.name
  
  class Destornillador(Herramienta):
      TAMANO_CHOICES = (
          ('Largo', 'Largo'),
          ('Medio', 'Medio'),
          ('Junior', 'Junior'),
      )
      tamano = models.CharField(max_length=80, choices=TAMANO_CHOICES,
                  default='Junior')
  
      def __str__(self):
          return "Destornillador de" + " tamano " + self.tamano
  
  class Llave(Herramienta):
      tamano = models.CharField(max_length=80)
  
  class Copa(Herramienta):
      tamano = models.CharField(max_length=80)
      mando = models.CharField(max_length=80)
  
      def __str__(self):
          return "copa " + self.tamano
  
  class Pistola(Herramienta):
      dimension = models.IntegerField(max_length=80)
      torque = models.IntegerField(max_length=80)
      presion_aire = models.IntegerField(max_length=80)
  
  class Playo(Herramienta):
      tamano = models.CharField(max_length=80)
      funcion = models.CharField(max_length=90)
  
  class Martillo(Herramienta):
      material = models.CharField(max_length=90)
  
  class Broca(Herramienta):
      utilidad = models.CharField(max_length=90)
      tamano = models.CharField(max_length=80)
  
      def __str__(self):
          return "Broca de " + self.utilidad + " de " + self.tamano
  
  class Lima(Herramienta):
      tamano = models.CharField(max_length=80)
  
  class Generico(Herramienta):
      caracteristicas = models.CharField(max_length=90)
  
  class InstrumentoDeMedida(Herramienta):
      rango = models.CharField(max_length=80)
      escala = models.CharField(max_length=80, blank=True)
  </code></pre>
  
  <p>Any ideas? Help is appreciated.</p>