title: Integrity error: update or delete violates foreign key constraint. Django + PostgreSQL
body: <p>This my UserProfile modification  </p>
  
  <pre><code> class UserProfile(models.Model):
          user = models.OneToOneField(User)
          fb_id = models.IntegerField(primary_key=True,null=False,blank=True)
          follows = models.ManyToManyField('self', related_name='followed_by', symmetrical=False)
      User.profile = property(lambda u: UserProfile.objects.get_or_create(user=u)[0])
  </code></pre>
  
  <p>I am receiving the following error after trying to delete all test users or any single of them.</p>
  
  <pre><code>    django.db.utils.IntegrityError: update or delete on table "blog_userprofile" violates foreign key constraint "blog_from_userprofile_id_a482ff43f3cdedf_fk_blog_userprofile_id" on table "blog_userprofile_follows"
  DETAIL:  Key (id)=(4) is still referenced from table "blog_userprofile_follows".
  </code></pre>
  
  <p>Cascade deleting shall be true by default, why I am receiving this and how can I fix? I am using PostgreSQL + Django 1.8</p>
  
  <p>EDIT: Little prerequisite: I'v changed <code>primary_key</code> from default to <code>fb_id</code>. And there were duplicates, because it was not set unique. So this error is raised when I try to migrate/makemigrations/syncdb :</p>
  
  <pre><code>   django.db.utils.IntegrityError: could not create unique index "blog_userprofile_fb_id_ce4e6e3086081d4_uniq"
  DETAIL:  Key (fb_id)=(0) is duplicated.
  </code></pre>
  
  <p>That is the reason why I tried to delete all test users</p>
  
  <p>And when I tried to reset everything, I tried to get back to default primary key, I receive :</p>
  
  <pre><code>django.db.utils.ProgrammingError: multiple default values specified for column "id" of table "blog_userprofile"
  </code></pre>