#35311: Addindex operation generates wrong sql code for Postgresql GinIndex
               Reporter:  Pierre     |          Owner:  nobody
  Juhen                              |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  5.0
  layer (models, ORM)                |       Keywords:  postgresql
               Severity:  Normal     |  migration
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |

 I created a Gin Index using :

 ''GinIndex(OpClass(Lower('title'),      name='gin_trgm_ops'),

 makemigrations generates the following code :

            '' model_name='affaire',
 name='gin_trgm_ops'), name='name_gin_trgm_title_affaire'),''

 SQLMIGRATE generates a wrong code :

 ''CREATE INDEX "name_gin_trgm_title_affaire" ON "affaires_affaire" USING
 gin ((LOWER("title")));''

 Instead of (too many parenthesis) :

 ''CREATE INDEX "name_gin_trgm_title_affaire" ON "affaires_affaire" USING
 gin (LOWER("title"));''

 There is a manual workaround, but its annoying.

 Thank you.

Ticket URL: <https://code.djangoproject.com/ticket/35311>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to