From 1ad9bfcb06aec3678c345fd97103f2c73396cd44 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 28 Nov 2022 21:47:31 -0700 Subject: Add GIN index to Post.hashtags --- activities/migrations/0002_hashtag.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activities/migrations') diff --git a/activities/migrations/0002_hashtag.py b/activities/migrations/0002_hashtag.py index 468bd95..c1b4bbd 100644 --- a/activities/migrations/0002_hashtag.py +++ b/activities/migrations/0002_hashtag.py @@ -1,5 +1,6 @@ # Generated by Django 4.1.3 on 2022-11-27 20:16 +import django.contrib.postgres.indexes from django.db import migrations, models import activities.models.hashtag @@ -48,4 +49,10 @@ class Migration(migrations.Migration): "abstract": False, }, ), + migrations.AddIndex( + model_name="post", + index=django.contrib.postgres.indexes.GinIndex( + fields=["hashtags"], name="hashtags_gin" + ), + ), ] -- cgit v1.2.3