Changes between Version 1 and Version 2 of Ticket #35311
- Timestamp:
- Mar 16, 2024, 5:29:52 AM (8 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35311
- Property Resolution → duplicate
- Property Status new → closed
-
Ticket #35311 – Description
v1 v2 3 3 I created a Gin Index using : 4 4 5 ''GinIndex(OpClass(Lower('title'), name='gin_trgm_ops'), name="name_gin_trgm_title_affaire"),'' 5 {{{ 6 GinIndex(OpClass(Lower('title'), name='gin_trgm_ops'), name="name_gin_trgm_title_affaire"),' 7 }}} 6 8 7 9 makemigrations generates the following code : 8 10 9 ''migrations.AddIndex( 11 {{{ 12 migrations.AddIndex( 10 13 '' model_name='affaire', 11 14 index=django.contrib.postgres.indexes.GinIndex(django.contrib.postgres.indexes.OpClass(django.db.models.functions.text.Lower('title'), name='gin_trgm_ops'), name='name_gin_trgm_title_affaire'),'' 12 15 ),'' 13 16 }}} 14 17 SQLMIGRATE generates a wrong code : 15 18 16 ''CREATE INDEX "name_gin_trgm_title_affaire" ON "affaires_affaire" USING gin ((LOWER("title"), name=gin_trgm_ops));'' 17 19 {{{ 20 CREATE INDEX "name_gin_trgm_title_affaire" ON "affaires_affaire" USING gin ((LOWER("title"), name=gin_trgm_ops));'' 21 }}} 18 22 Instead of (too many parenthesis) : 19 23 20 ''CREATE INDEX "name_gin_trgm_title_affaire" ON "affaires_affaire" USING gin (LOWER("title"), name=gin_trgm_ops);'' 24 {{{ 25 CREATE INDEX "name_gin_trgm_title_affaire" ON "affaires_affaire" USING gin (LOWER("title"), name=gin_trgm_ops);'' 26 }}} 21 27 22 28 There is a manual workaround, but its annoying.