Monday, August 3, 2015

Need help with auto_now_add and auto_now fields

Hello Team,

I have a model and I have added two fields to User_Address model creation_date and updation_date. I have pasted the model code at pastebin. Please take a look. 

I am getting following error while running makemigrations command 

You are trying to add a non-nullable field 'creation_date' to user_address witho
ut a default; we can't do that (the database needs something to populate existin
g rows).
Please select a fix:
 1) Provide a one-off default now (will be set on all existing rows)
 2) Quit, and let me add a default in models.py
Select an option: 

Please help...

Regards,
Sarfaraz Ahmed

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/93c56122-26f6-4bb1-89b5-d1b310c0fb68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment