title: Django migration dependencies reference nonexistent parent node
body: <p>I have a problem with django migrations. I get this error:</p>
  
  <blockquote>
    <p>django.db.migrations.exceptions.NodeNotFoundError: Migration user.0050_merge_20170523_1254 dependencies reference nonexistent parent node ('user', '0049_auto_20170519_1934')</p>
  </blockquote>
  
  <p>I fix the errors, deleting some lines but after I fix all these errors, I get another:</p>
  
  <blockquote>
    <p>ValueError: Could not find common ancestor of {'0050_merge_20170523_1254', '0007_auto_20170524_1540'}</p>
  </blockquote>
  
  <p>I can't solve that. I can drop database and do makemigrations again... but in production environment, I'd want to know how to fix this correctly, without drop database haha.</p>
  
  <p>Thanks!</p>