I have created a model in Django.
class MyModel(models.Model):
features = TextField(blank=True, default='')
There are several possible ways to store the data in the feature field. Some examples below.
feature1;feature2feature1, feature2feature1,feature2
And so on. I need to create a GIN index for that field. I would probably do it in postgreSQL in the following way
CREATE INDEX features_search_idx ON "mymodel" USING gin (regexp_split_to_array("mymodel"."features", E'[,;\\s]+'));
Would it be possible to do the same thing by a migration?