title: Django: Foreign Key to a partitioned table
body: <p>I have used <a href="https://architect.readthedocs.io/" rel="nofollow noreferrer">architect</a> to partition an existing table.</p>
  
  <pre><code>@architect.install('partition', type='range', subtype='integer', constraint='100', column='id')
  class Project(models.Model):
      name = models.CharField(max_length=150)
  </code></pre>
  
  <p>The project model was used as a foreign key to another model. </p>
  
  <pre><code>class ProjectChangeLog(models.Model):
      project = models.ForeignKey(Project, on_delete=models.CASCADE)
  </code></pre>
  
  <p>After partitioning, I could not add any ProjectChangeLog objects. It says:</p>
  
  <pre><code>IntegrityError: insert or update on table "logging_projectchangelog" violates foreign key constraint 
  DETAIL:  Key (project_id)=(231) is not present in table "project_project"
  </code></pre>