1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

[1.5.x] Fixed #19441 -- Created PostgreSQL varchar index when unique=True

Thanks Dylan Verheul for the report and Anssi Kääriäinen for the
review.
Backport of 55972ee5c from master.
This commit is contained in:
Claude Paroz
2012-12-18 09:56:30 +01:00
parent 1caa483914
commit ddea0e0d7e
3 changed files with 25 additions and 5 deletions

View File

@@ -9,3 +9,9 @@ class Article(models.Model):
index_together = [
["headline", "pub_date"],
]
class IndexedArticle(models.Model):
headline = models.CharField(max_length=100, db_index=True)
body = models.TextField(db_index=True)
slug = models.CharField(max_length=40, unique=True, db_index=True)