diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-12-16 10:52:15 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-12-16 10:52:15 +0100 |
commit | 4364e8e447f511b574c30c342082b05918496bca (patch) | |
tree | effa65c83a7c98dfaf06ebe3fc13bb00b5a901b1 /archaeological_context_records | |
parent | 46fcb2d2354d71b53fd0f72af62b224e50370211 (diff) | |
download | Ishtar-4364e8e447f511b574c30c342082b05918496bca.tar.bz2 Ishtar-4364e8e447f511b574c30c342082b05918496bca.zip |
Gin index for data fields
Diffstat (limited to 'archaeological_context_records')
3 files changed, 51 insertions, 0 deletions
diff --git a/archaeological_context_records/migrations/0055_auto_20191216_1013.py b/archaeological_context_records/migrations/0055_auto_20191216_1013.py new file mode 100644 index 000000000..ddd2d6cc2 --- /dev/null +++ b/archaeological_context_records/migrations/0055_auto_20191216_1013.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-12-16 10:13 +from __future__ import unicode_literals + +import django.contrib.postgres.fields.jsonb +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0054_auto_20190910_1324'), + ] + + operations = [ + migrations.AlterField( + model_name='contextrecord', + name='data', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}), + ), + migrations.AlterField( + model_name='historicalcontextrecord', + name='data', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}), + ), + ] diff --git a/archaeological_context_records/migrations/0056_auto_20191216_1031.py b/archaeological_context_records/migrations/0056_auto_20191216_1031.py new file mode 100644 index 000000000..ee2daadf8 --- /dev/null +++ b/archaeological_context_records/migrations/0056_auto_20191216_1031.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-12-16 10:31 +from __future__ import unicode_literals + +import django.contrib.postgres.indexes +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0055_auto_20191216_1013'), + ('ishtar_common', '0116_create_gist_extension'), + ] + + operations = [ + migrations.AddIndex( + model_name='contextrecord', + index=django.contrib.postgres.indexes.GinIndex(fields=['data'], name='archaeologi_data_1c3119_gin'), + ), + ] diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 96103600f..febc7cfdd 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -22,6 +22,7 @@ import uuid from django.conf import settings from django.contrib.gis.db import models +from django.contrib.postgres.indexes import GinIndex from django.core.urlresolvers import reverse from django.db import connection from django.db.models import Q @@ -565,6 +566,9 @@ class ContextRecord(BulkUpdatedItem, DocumentItem, BaseHistorizedItem, ("delete_own_contextrecord", "Can delete own Context Record"), ) ordering = ('cached_label',) + indexes = [ + GinIndex(fields=['data']), + ] def natural_key(self): return (self.uuid, ) |