Code

Ticket #13773: postgresql_db_type.diff

File postgresql_db_type.diff, 738 bytes (added by Suor, 4 years ago)
Line 
1Index: django/db/backends/postgresql/creation.py
2===================================================================
3--- django/db/backends/postgresql/creation.py   (revision 13353)
4+++ django/db/backends/postgresql/creation.py   (working copy)
5@@ -63,7 +63,7 @@
6             # a second index that specifies their operator class, which is
7             # needed when performing correct LIKE queries outside the
8             # C locale. See #12234.
9-            db_type = f.db_type()
10+            db_type = f.db_type(connection=self.connection)
11             if db_type.startswith('varchar'):
12                 output.append(get_index_sql('%s_%s_like' % (db_table, f.column),
13                                             ' varchar_pattern_ops'))