-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How fix problemm django.db.utils.IntegrityError: UNIQUE constraint failed? #8
Comments
@alimuradov I had this same problem, and found documentation on Adding a unique field in the migrations documentation. Basically: You add the field without unique=true in one operation, make a data migration that generates the correct shortuuids for you, and then change the field too unique again. |
DO THESE |
I'm no longer using or in a position to test this library, but am happy to review and merge any PR's that address this or other issues if you're finding the library to be helpful. |
I didn't understand completely what happened but it's work for me Thank You <3 |
Thanks you, the solution is great. |
I get this error even after I get rid of the unique field or set it to false, which I think is a key point that no one has pointed out yet that makes the error so devious. |
This doesn't work for me. There is no update between the fake and real migrations, and the database column missing error I have due to the original issue is not handled. |
what actually is this but its working fine |
Tenta definir default=uuid.uuid4 do champo no model UUIDField. |
My migration has the form
`# -- coding: utf-8 --
Generated by Django 1.9.2 on 2016-03-03 15:52
from future import unicode_literals
from django.db import migrations
import shortuuidfield.fields
class Migration(migrations.Migration):
`
When I try to run migrate myapp, I get the error
table patient_customer has no column named uuid
The text was updated successfully, but these errors were encountered: