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 | da31c986df9f151417348432bb64ee62ad7fa403 (patch) | |
tree | effa65c83a7c98dfaf06ebe3fc13bb00b5a901b1 /archaeological_warehouse | |
parent | 4c9844f9c41e7fccb98228b55b26b15bfb6db364 (diff) | |
download | Ishtar-da31c986df9f151417348432bb64ee62ad7fa403.tar.bz2 Ishtar-da31c986df9f151417348432bb64ee62ad7fa403.zip |
Gin index for data fields
Diffstat (limited to 'archaeological_warehouse')
4 files changed, 86 insertions, 0 deletions
diff --git a/archaeological_warehouse/migrations/0042_auto_20191216_1014.py b/archaeological_warehouse/migrations/0042_auto_20191216_1014.py new file mode 100644 index 000000000..cf403284b --- /dev/null +++ b/archaeological_warehouse/migrations/0042_auto_20191216_1014.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-12-16 10:14 +from __future__ import unicode_literals + +import django.contrib.postgres.fields.jsonb +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_warehouse', '0041_auto_20190912_1518'), + ] + + operations = [ + migrations.AlterField( + model_name='collection', + name='data', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}), + ), + migrations.AlterField( + model_name='container', + name='data', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}), + ), + migrations.AlterField( + model_name='warehouse', + name='data', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}), + ), + ] diff --git a/archaeological_warehouse/migrations/0043_auto_20191216_1027.py b/archaeological_warehouse/migrations/0043_auto_20191216_1027.py new file mode 100644 index 000000000..e918ca490 --- /dev/null +++ b/archaeological_warehouse/migrations/0043_auto_20191216_1027.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-12-16 10:27 +from __future__ import unicode_literals + +import django.contrib.postgres.indexes +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('ishtar_common', '0116_create_gist_extension'), + ('archaeological_warehouse', '0042_auto_20191216_1014'), + ] + + operations = [ + migrations.AddIndex( + model_name='warehouse', + index=django.contrib.postgres.indexes.GinIndex(fields=['data'], name='archaeologi_data_49b6ad_gin'), + ), + ] diff --git a/archaeological_warehouse/migrations/0044_auto_20191216_1050.py b/archaeological_warehouse/migrations/0044_auto_20191216_1050.py new file mode 100644 index 000000000..2794079f1 --- /dev/null +++ b/archaeological_warehouse/migrations/0044_auto_20191216_1050.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-12-16 10:50 +from __future__ import unicode_literals + +import django.contrib.postgres.indexes +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_warehouse', '0043_auto_20191216_1027'), + ] + + operations = [ + migrations.AddIndex( + model_name='collection', + index=django.contrib.postgres.indexes.GinIndex(fields=['data'], name='archaeologi_data_4a4a83_gin'), + ), + migrations.AddIndex( + model_name='container', + index=django.contrib.postgres.indexes.GinIndex(fields=['data'], name='archaeologi_data_edae47_gin'), + ), + ] diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index de567d26e..64a766cea 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/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.models import Q, Max from django.db.models.signals import post_save, post_delete, m2m_changed @@ -134,6 +135,9 @@ class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem, ("change_own_warehouse", u"Can change own Warehouse"), ("delete_own_warehouse", u"Can delete own Warehouse"), ) + indexes = [ + GinIndex(fields=['data']), + ] def __str__(self): return self.name @@ -359,6 +363,9 @@ class Collection(LightHistorizedItem): verbose_name = _(u"Collection") verbose_name_plural = _(u"Collection") ordering = ('name',) + indexes = [ + GinIndex(fields=['data']), + ] def __str__(self): return self.name @@ -639,6 +646,9 @@ class Container(DocumentItem, LightHistorizedItem, QRCodeItem, GeoItem, ("change_own_container", u"Can change own Container"), ("delete_own_container", u"Can delete own Container"), ) + indexes = [ + GinIndex(fields=['data']), + ] def __str__(self): return self.cached_label or "" |