1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.5.x] Created special PostgreSQL text indexes when unique is True

Refs #19441.
Backport of c698c55966 from master.
This commit is contained in:
Claude Paroz
2013-01-07 17:54:30 +01:00
parent 7ca9b71628
commit 012229914c
3 changed files with 5 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ class DatabaseCreation(BaseDatabaseCreation):
def sql_indexes_for_field(self, model, f, style):
output = []
if f.db_index:
if f.db_index or f.unique:
qn = self.connection.ops.quote_name
db_table = model._meta.db_table
tablespace = f.db_tablespace or model._meta.db_tablespace