This is my models:
class Role(models.Models):
name = .....
class User(AbstractUser):
role = ForeignKey(
"core.Role",
related_name="users_of_type",
blank=True,
null=True,
on_delete=SET_NULL,
)
I changed name of models UserType to Role . When I developed, i created migrations and migrates several times so it everything was OK. But when I deployed to production, I migrated and the problems began.
Django applied and ran migrations file from app core before user. So the table name was changed to core_role but in user it still using UserType as foreign key. So I can not migrate and do anything in my production.
Any one can help me with this. I’m very nervous because it my company product