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_files | |
parent | a2ae7228cae62c4fde1f9554372162d322e69aa9 (diff) | |
download | Ishtar-74ede4d3b306ac49052ee1a91737068f5da7a89b.tar.bz2 Ishtar-74ede4d3b306ac49052ee1a91737068f5da7a89b.zip |
Performance: add indexes for cached labels
Diffstat (limited to 'archaeological_files')
-rw-r--r-- | archaeological_files/migrations/0009_auto_20171012_1316.py | 25 | ||||
-rw-r--r-- | archaeological_files/models.py | 3 |
2 files changed, 27 insertions, 1 deletions
diff --git a/archaeological_files/migrations/0009_auto_20171012_1316.py b/archaeological_files/migrations/0009_auto_20171012_1316.py new file mode 100644 index 000000000..cd33d8243 --- /dev/null +++ b/archaeological_files/migrations/0009_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_files', '0008_auto_20171011_1644'), + ] + + operations = [ + migrations.AlterField( + model_name='file', + name='cached_label', + field=models.TextField(blank=True, db_index=True, null=True, verbose_name='Cached name'), + ), + migrations.AlterField( + model_name='historicalfile', + name='cached_label', + field=models.TextField(blank=True, db_index=True, null=True, verbose_name='Cached name'), + ), + ] diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 0d5b4b3e8..b0f53f11c 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -204,7 +204,8 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, mh_listing = models.NullBooleanField( u"Sur Monument Historique inscrit", blank=True, null=True) # <-- research archaeology - 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) imported_line = models.TextField(_(u"Imported line"), null=True, blank=True) history = HistoricalRecords() |