title: Running ./manage.py migrate during Heroku deployment
body: <p>I am working on a Django app, and I would like my Database migrations to be run when deploying on Heroku.</p>
  
  <p>So far we have simply put the following command in the Procfile:</p>
  
  <pre><code>python manage.py migrate
  </code></pre>
  
  <p>When deploying the migrations are indeed run, but they seem to be run once for each dyno (and we use several dynos). As a consequence, data migrations (as opposed to pure schema migrations) are run several times, and data is duplicated.</p>
  
  <p>Running <code>heroku run python manage.py migrate</code> after the deployment is not satisfactory since we want the database to be in sync with the code at all times.</p>
  
  <p>What is the correct way to do this in Heroku?</p>
  
  <p>Thanks.</p>