django.db.utils.IntegrityError: column "color_set_id" contains null values
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Track title: CC P Beethoven - Piano Sonata No 2 in A
--
Chapters
00:00 Django.Db.Utils.Integrityerror: Column &Quot;Color_set_id&Quot; Contains Null Values
01:39 Answer 1 Score 6
02:10 Accepted Answer Score 2
02:30 Thank you
--
Full question
https://stackoverflow.com/questions/4627...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #python3x #djangomodels #djangoadmin
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Track title: CC P Beethoven - Piano Sonata No 2 in A
--
Chapters
00:00 Django.Db.Utils.Integrityerror: Column &Quot;Color_set_id&Quot; Contains Null Values
01:39 Answer 1 Score 6
02:10 Accepted Answer Score 2
02:30 Thank you
--
Full question
https://stackoverflow.com/questions/4627...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #python3x #djangomodels #djangoadmin
#avk47
ANSWER 1
Score 6
Follow these steps
python manage.py migrate --fake
comment
color_set- python manage.py makemigrations && python manage.py migrate
- uncomment
color_set - python manage.py makemigrations && python manage.py migrate
ACCEPTED ANSWER
Score 2
The problem is because you added null=True after creating the migration file. Follow these steps now.
1) Drop ColorSet & Product tables from your local table database.
2) Delete all the migration files you created for these `CharField to a ForeignKey` change
3) execute `python manage.py makemigrations`
4) execute 'python manage.py migrate'