diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-12 13:17:17 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-12 13:17:17 +0200 |
| commit | 74ede4d3b306ac49052ee1a91737068f5da7a89b (patch) | |
| tree | 7d3f57ec13a117bbbaa8cd9e5117b2478456cd0f /archaeological_context_records | |
| parent | a2ae7228cae62c4fde1f9554372162d322e69aa9 (diff) | |
| download | Ishtar-74ede4d3b306ac49052ee1a91737068f5da7a89b.tar.bz2 Ishtar-74ede4d3b306ac49052ee1a91737068f5da7a89b.zip | |
Performance: add indexes for cached labels
Diffstat (limited to 'archaeological_context_records')
| -rw-r--r-- | archaeological_context_records/migrations/0011_auto_20171012_1316.py | 25 | ||||
| -rw-r--r-- | archaeological_context_records/models.py | 3 |
2 files changed, 27 insertions, 1 deletions
diff --git a/archaeological_context_records/migrations/0011_auto_20171012_1316.py b/archaeological_context_records/migrations/0011_auto_20171012_1316.py new file mode 100644 index 000000000..95b042c43 --- /dev/null +++ b/archaeological_context_records/migrations/0011_auto_20171012_1316.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11 on 2017-10-12 13:16 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0010_auto_20171011_1644'), + ] + + operations = [ + migrations.AlterField( + model_name='contextrecord', + name='cached_label', + field=models.TextField(blank=True, db_index=True, null=True, verbose_name='Cached name'), + ), + migrations.AlterField( + model_name='historicalcontextrecord', + name='cached_label', + field=models.TextField(blank=True, db_index=True, null=True, verbose_name='Cached name'), + ), + ] diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 2f02ed9df..9162a8aa0 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -302,7 +302,8 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, point_2d = models.PointField(_(u"Point (2D)"), blank=True, null=True) point = models.PointField(_(u"Point (3D)"), blank=True, null=True, dim=3) polygon = models.PolygonField(_(u"Polygon"), blank=True, null=True) - cached_label = models.TextField(_(u"Cached name"), null=True, blank=True) + cached_label = models.TextField(_(u"Cached name"), null=True, blank=True, + db_index=True) history = HistoricalRecords() class Meta: |
