title: django south postgresql foreign key constraint require a row of id zero?
body: <p>I am using Django with South as the data migration tool for a Postgresql database. </p>
  
  <p>What I have met is such a situation: if I add a field in a model which is a foreign key related with another model. I generate the migration file with </p>
  
  <p><code>./manage.py schemamigration users --auto</code></p>
  
  <p>but an error occurred if trying to </p>
  
  <p><code>./manage.py migrate users 00xx</code> </p>
  
  <p>with the files generated. </p>
  
  <pre><code>django.db.utils.IntegrityError: insert or update on table "users_userlikemessage" violates foreign key constraint "message_id_refs_id_57ff7c7c"
  
  DETAIL:  Key (message_id)=(0) is not present in table "message_article".
  </code></pre>
  
  <p>What I have done to solve the problem is just go to the last row of the <code>message_artile</code> model from pdAdmin tool and change the id of the row to <code>0</code>, and re-run the migrate command.</p>
  
  <p>Though this solved the migration problem, but I am not able to change that <code>0</code> id back to what it was, due to that existing FK constraint. </p>
  
  <p>So, my questions are:</p>
  
  <ol>
  <li>What is the reason that <code>0</code> valued pk must exist before the FK constraint can be established?</li>
  <li>Is there a better way to solve this? </li>
  <li>Does this existing FK constraint have a side effect to future use of the database?</li>
  <li>Does it make sense to have a <code>0</code> valued pk in Postgresql database?</li>
  </ol>