﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30570	Integrity errors in Django project with custom User model.	siriuslan	nobody	"I am setting up a new django(version 2.2) project and want to use custom user model. When I load fixtures data, it failed with error like below:

django.db.utils.IntegrityError: Problem installing fixtures: insert or update on table ""doctors_doctor"" violates foreign key constraint ""doctors_doctor_user_ptr_id_ba968804_fk_doctors_user_id"" DETAIL: Key (user_ptr_id)=(1) is not present in table ""doctors_user"".

From django document - https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project I realized I did 'python manage.py migrate' before changing AUTH_USER_MODEL in settings.py. So I tried to delete all tables and redo 'python manage.py migrate', but it still hit this problem.

I can see there is another ticket - https://code.djangoproject.com/ticket/23297 complaining the same issue, I follow the solution for it but not working. No idea why."	Bug	closed	Migrations	dev	Normal	invalid			Unreviewed	0	0	0	0	0	0
