title: django - deleting User raises integrity error
body: <p>I am doing a "Reddit Clone" using django and these are my models:</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Profile(models.Model):
      owner = models.OneToOneField(User, on_delete=models.CASCADE)
      dob = models.DateField()
      karma = models.IntegerField(default=0)
  
  class Subreddit(models.Model):
      owner = models.ForeignKey(Profile, on_delete=models.DO_NOTHING, null=True, blank=True, related_name='subreddits')
      name = models.CharField(max_length=100)
      title = models.CharField(max_length=100)
      description = models.CharField(max_length=500)
      subscribers = models.ManyToManyField(Profile, blank=True, related_name='subscriptions')
      moderators = models.ManyToManyField(Profile, blank=True, related_name='moderates')
  
  class Post(models.Model):
      owner = models.ForeignKey(Profile, on_delete=models.DO_NOTHING)
      title = models.CharField(max_length=300)
      content = models.CharField(max_length=1000)
      votes = models.IntegerField()
      created_at = models.DateTimeField(auto_now_add=True)
      updated_at = models.DateTimeField(auto_now=True)
      subreddit = models.ForeignKey(Subreddit, on_delete=models.CASCADE)
  
  class Comment(models.Model):
      owner = models.ForeignKey(Profile, on_delete=models.DO_NOTHING)
      content = models.CharField(max_length=500)
      votes = models.IntegerField()
      created_at = models.DateTimeField(auto_now_add=True)
      updated_at = models.DateTimeField(auto_now=True)
      parent_post = models.ForeignKey(Post, on_delete=models.CASCADE)
      parent_comment = models.ForeignKey("Comment", null=True, blank=True, on_delete=models.CASCADE)
  </code></pre>
  
  <p>Now, I tried to delete a <code>user</code> who just made 1 <code>comment</code>. When I tried to delete the <code>user</code> from <code>django admin</code>, I got the following error.</p>
  
  <blockquote>
    <p>IntegrityError at /admin/auth/user/2/delete/ (1451, 'Cannot delete or
    update a parent row: a foreign key constraint fails
    (<code>redditdb</code>.<code>redditapp_comment</code>, CONSTRAINT
    <code>redditapp_comment_owner_id_fdc65fee_fk_redditapp_profile_id</code> FOREIGN
    KEY (<code>owner_id</code>) REFERENCES <code>redditapp_profile</code> (<code>id</code>))')</p>
  </blockquote>
  
  <p>I did user <code>on_delete=models.CASCADE</code> so I don't know why I am getting this error. Do I need to restructure the foreign keys in my models?</p>
  
  <hr>
  
  <p>Actually reddit follows a structure where when a parent comment is deleted, its child comments won't get deleted. The deleted parent comment will be dashed or striked out and its child comments are still shown. Knowing this, how do I move forward with my code, should I delete profiles at all?</p>