django.db.migrations.exceptions.CircularDependencyError
Temporarily comment out foreign keys to break the circular dependency. It looks like you could do this by commenting out Hospital.doctor
. Remove the existing migrations and run makemigrations
to recreate them.
Finally, uncomment the foreign keys, and run makemigrations
again. You should end up with migrations without any circular dependencies.