Ticket #840 (closed defect: invalid)

Opened 3 years ago

Last modified 2 years ago

error with unique field in postgresql database

Reported by: yasar11732@… Owned by: andrew
Priority: minor Milestone: 1.0
Component: migrations Version: unknown
Keywords: Cc:



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.


Change History

comment:1 Changed 3 years ago by andrew

  • Priority changed from blocker to minor
  • Status changed from new to infoneeded
  • Milestone set to 1.0

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

comment:2 Changed 2 years ago by andrew

  • Status changed from infoneeded to closed
  • Resolution set to invalid

No response - closing.


Add a comment

Modify Ticket

as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.