irfanpule / django-form-surveys

Django form survey is an application Django to easier create form survey and easy integrated for your project.
MIT License
56 stars 19 forks source link

Error migration #40

Closed Gutei closed 1 year ago

Gutei commented 1 year ago

I already have DB with the previous version DJF 1.6.5 and I got an error when running the migration of file 0010_model_translation ...

msg :

django.db.utils.IntegrityError: duplicate key value violates unique constraint "djf_surveys_question_key_key"
DETAIL:  Key (key)=() already exists.

can you help with that !!

irfanpule commented 1 year ago

Hi @Gutei I think error message show because on model unique=True, default="". if you have two value empty string, django will give error "duplicate key value".

To solve this problem, I will revert the model to unique=True, null=True, blank=True as used in version 1.6.5