Commits

Anonymous committed 867f523

Warning for ghost migrations

  • Participants
  • Parent commits a5562a1

Comments (0)

Files changed (1)

             missing.append(migration)
             offset += 1
     
+    # Make sure the database doesn't have nonexistent migrations in it
+    ghost_migrations = [m for m in current_migrations if m not in migrations]
+    if ghost_migrations:
+        print " ! These migrations are in the database but not on disk:"
+        print "   - " + "\n   - ".join(ghost_migrations)
+        print " ! I'm not trusting myself; fix this yourself by fiddling"
+        print " ! with the south_migrationhistory table."
+        return
+    
     if offset:
         current += offset