1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Fixed #28646 -- Prevented duplicate index when unique is set to True on PostgreSQL.

This commit is contained in:
Ben Cail
2024-02-01 16:08:42 -05:00
committed by Sarah Boyce
parent 7e00fee3bd
commit 9cf9c796be
6 changed files with 305 additions and 11 deletions

View File

@@ -147,6 +147,20 @@ class IntegerPK(models.Model):
db_table = "INTEGERPK" # uppercase to ensure proper quoting
class CharFieldPK(models.Model):
field1 = models.CharField(max_length=10, primary_key=True)
class Meta:
apps = new_apps
class CharFieldPKUnique(models.Model):
field1 = models.CharField(max_length=10, primary_key=True, unique=True)
class Meta:
apps = new_apps
class Note(models.Model):
info = models.TextField()
address = models.TextField(null=True)