I'm having a field that I've added to another branch (which is in developing status ) calling money
, with default value: 0.00
in the User
model. However, it is not yet being used in the production branch.
Today when I went to do a test to create an account, I received the following error:
IntegrityError at /users/register
(1364, "Field 'money' doesn't have a default value")
I noticed that in my MySQL there is still the money
field that I created in another branch. However, in the database it does not have a default value.
class User(AbstractUser):
...
money = models.DecimalField(max_digits=8, decimal_places=2, null=True, default=0.00)
I would like to understand why Django did not default to MySQL 0.00. This is causing a problem in account creation, but it should not have been created as a default value. Does Django manually default value ?