Modify ↓
Ticket #840 (closed defect: invalid)
error with unique field in postgresql database
| Reported by: | yasar11732@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.0 |
| Component: | migrations | Version: | unknown |
| Keywords: | Cc: |
Description
Hi,
I changed my model from this:
class Setting(models.Model):
anahtar = models.CharField?(max_length=20,unique=True)
deger = models.CharField?(max_length=40)
def unicode(self):
return self.anahtar
To this,
class Setting(models.Model):
anahtar = models.CharField?(max_length=20,unique=True)
deger = models.CharField?(max_length=100)
def unicode(self):
return self.anahtar
Schema migration command completed successfully, but, trying to migrate gives me this error:
IntegrityError?: duplicate key value violates unique constraint "blog_setting_anahtar_key"
DETAIL: Key (anahtar)=(blog_baslik) already exists.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

I doubt the migration is adding any rows; could you post the full traceback?