Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Create btree_gin extension

Roland Geider6b11bcb79525
diff --git a/wger/nutrition/migrations/0020_full_text_search.py b/wger/nutrition/migrations/0020_full_text_search.py
index 6e57f07b7..eeafc59ee 100644
--- a/wger/nutrition/migrations/0020_full_text_search.py
+++ b/wger/nutrition/migrations/0020_full_text_search.py
@@ -2,6 +2,7 @@
import django.contrib.postgres.indexes
import django.contrib.postgres.search
+from django.contrib.postgres.operations import BtreeGinExtension
from django.db import migrations
@@ -11,6 +12,9 @@ class Migration(migrations.Migration):
]
operations = [
+ # A GIN index over a varchar column needs btree_gin. The extension is also
+ # created in exercises 0029, but nothing guarantees that runs first.
+ BtreeGinExtension(),
migrations.AddIndex(
model_name='ingredient',
index=django.contrib.postgres.indexes.GinIndex(