기존 model에 새로운 field를 추가하고 makemigrations와 migrate를 하면서 다음과 같은 문제가 발생하였다.
어떻게 이 문제를 해결하고 새로운 field를 추가할 땐 어떻게 해야하는가?
python manage.py makemigrations ->
You are trying to add a non-nullable field 'name' to member without a default; we can't do that (the database
needs something to populate existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit, and let me add a default in models.py
Select an option:1
python manage.py migrate ->
django.db.utils.OperationalError: (1067, "Invalid defagrateult value for 'name'")
기존 model에 새로운 field를 추가하고 makemigrations와 migrate를 하면서 다음과 같은 문제가 발생하였다. 어떻게 이 문제를 해결하고 새로운 field를 추가할 땐 어떻게 해야하는가?
python manage.py makemigrations ->
python manage.py migrate ->