Got an integrity error as shown in job `
class JobSerializer(ModelSerializer):
company = CompanySerializer(read_only=True)
skills = SkillSerializer(many=True, read_only=True)
class Meta:
fields = ['title', 'description', 'max_salary', 'min_salary', 'employment_type', 'max_experience',
'min_experience', 'company', 'location', 'industry_type', 'skills']
model = Job
`
Nested Serializer got this error
`
Django Version: 4.1.3
Exception Type: IntegrityError
Exception Value:
NOT NULL constraint failed: naukriapp_job.company_id
Exception Location: D:\naukri\naukrienv\lib\site-packages\django\db\backends\sqlite3\base.py, line 357, in execute
Raised during: naukriapp.views.Jobviewset
Python Executable: D:\naukri\naukrienv\Scripts\python.exe
` I need to rectify this integrity error
Please modify your models where you have used a foreign key.
By following the above approach integrity issue will get resolved.