Exception Type: OperationalError at /admin/firstapp/employee/ Exception Value: no such column: firstapp_employee.user_id

Hi i'm new to django & was trying to migrate my model when i received this error.Any suggestions?

this is my models.py (i'm trying to create one to one relationship b/w user & Employee model)

from django.db import models
from django.contrib.auth.models import User
# Create your models here.

class Employee(models.Model):
    First_Name = models.CharField(max_length=200,blank=False,null=False)
    Last_Name = models.CharField(max_length=200)
    DOB = models.DateField()
    user = models.OneToOneField(User,on_delete=models.CASCADE,default='')

    def __str__(self):

        return self.First_Name
step:-1 Delete migrations folder from app
step:-2 Delete database
step:-3 python manage.py makemigrations your_app_name
step:-4 python manage.py migrate

===== Output ============

enter image description here

Back to Top