Migrations is not working for this model in my project

I have create multiple models in Django project but this model migration is not working in my project can anybody give me the reason for tis problem and how to fix this.

models.py

class Profile(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
avatar=models.ImageField(upload_to='avatar/',blank=True,null=True)

def __str__(self):
    return f"{self.user.email}"

running migrations output is no change in Migration

If i am not wrong after creating new models and updating existing models fields we have to run a command which is "python manage.py makemigrations" then we migrate these changes to the databases if you have done this already then i think you are having any of the following issues...

1: Make sure that your models.py file is in the app.

2: Make sure you app is listed in the list of installed_apps in settings.py

3: Check if the models.py file is save or not.

class Profile(models.Model):
      user=models.OneToOneField(User,on_delete=models.CASCADE)
      avatar=models.ImageField(upload_to='avatar/',blank=True,null=True)

def __str__(self):
    return self.user.email
Вернуться на верх