title: django ForeignKey null = true
body: <pre><code>from django.db import models
  
  class Story(models.Model):
      id = models.IntegerField(primary_key=True)
      news_type = models.CharField(max_length=255,null=True)
      category_id = models.CharField(max_length=255,null=True)
      title = models.CharField(max_length=255,null=True)
      created = models.DateTimeField(null=True)
      author = models.CharField(max_length=255, null=True)
      author_title = models.CharField(max_length=255, null=True)
      image_caption = models.TextField(null=True)
      image_credit = models.CharField(max_length=255,null=True)
      image_full_url = models.CharField(max_length=255,null=True)
      body = models.TextField(null=True)
      summary = models.TextField(null=True)
      video_id = models.CharField(max_length=255,null=True)
      external_url = models.CharField(max_length=255,null=True)
      order = models.IntegerField(null=True)
  
  class StoryFactBox(models.Model):
      story = models.ForeignKey('Story', null = True)
      body = models.TextField()
  
  class StoryKeyword(models.Model):
      story = models.ForeignKey('Story', null = True)
      keyword = models.CharField(max_length=255)
  </code></pre>
  
  <p>What schema changes does <code>models.ForeignKey('Story', null = True)</code> cause to happen?</p>
  
  <p>I am reading from the docs:</p>
  
  <p>I want to use remove() and clear() and this is part of documentation.</p>
  
  <p>In order to prevent database inconsistency, this method only exists on ForeignKey objects where null=True. If the related field can't be set to None (NULL), then an object can't be removed from a relation without being added to another. In the above example, removing e from b.entry_set() is equivalent to doing e.blog = None, and because the blog ForeignKey doesn't have null=True, this is invalid.</p>