Shepherd icon indicating copy to clipboard operation
Shepherd copied to clipboard

Unable to import domains UNIQUE constraint failed: catalog_domain.registrar

Open g-unit123 opened this issue 5 years ago • 3 comments

When importing domains using the import csv feature, the following error appears when domains have the same registrar as a pre-existing domains

Issue processing data for 'example.com': IntegrityError('UNIQUE constraint failed: catalog_domain.registrar')

g-unit123 avatar Mar 13 '19 16:03 g-unit123

Thanks for bringing this to my attention. That's a simple thing to correct. The field is just inappropriately marked as Unique.

chrismaddalena avatar Apr 16 '19 20:04 chrismaddalena

I am also experiencing this issue, though i have modified models.py and removed the unique field, and also tried setting it to False. I currently have one domain that I manually added through the webservice, which has the same registrar information as the data I am attempting to import via CSV.

-- Error Issue processing data for 'mydomain.com': IntegrityError('UNIQUE constraint failed: catalog_domain.registrar')

--Relevant line from models.py registrar = models.CharField('Registrar', max_length=100, help_text='Enter the name of the registrar where this domain is registered', null=True)

Please let me know if I can provide any additional information. Thanks.

linuxkd avatar Oct 02 '19 20:10 linuxkd

Turns out the issue is also present in catalog/migrations/0001_initial.py and that is making its way into the database.

linuxkd avatar Oct 03 '19 14:10 linuxkd