diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-01-09 22:07:27 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-01-09 22:07:27 +0000 |
commit | 486a50f876354a8447886a33042f0f7517316078 (patch) | |
tree | 98dcab89fd69062cbd7db7a077ce93debbc78cc5 | |
parent | 219b8b792e2a6e1fb72b9e658b06395a50292e59 (diff) | |
download | troggle-486a50f876354a8447886a33042f0f7517316078.tar.gz troggle-486a50f876354a8447886a33042f0f7517316078.tar.bz2 troggle-486a50f876354a8447886a33042f0f7517316078.zip |
Added two indexes to foreign keys
-rw-r--r-- | core/models/logbooks.py | 2 | ||||
-rw-r--r-- | core/models/survex.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/core/models/logbooks.py b/core/models/logbooks.py index a5239f7..1c7c9f7 100644 --- a/core/models/logbooks.py +++ b/core/models/logbooks.py @@ -175,7 +175,7 @@ class PersonLogEntry(TroggleModel): personexpedition = models.ForeignKey("PersonExpedition", null=True, on_delete=models.CASCADE) time_underground = models.FloatField(help_text="In decimal hours") - logbook_entry = models.ForeignKey(LogbookEntry, on_delete=models.CASCADE) + logbook_entry = models.ForeignKey(LogbookEntry, on_delete=models.CASCADE, db_index=True) is_logbook_entry_author = models.BooleanField(default=False) nickname_used = models.CharField(max_length=100,default="") # e.g. "Animal" or "Zonker", as it appears in the original logbook diff --git a/core/models/survex.py b/core/models/survex.py index 6b9a818..fabc381 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -205,7 +205,7 @@ class SurvexBlock(models.Model): expedition = models.ForeignKey("Expedition", blank=True, null=True, on_delete=models.SET_NULL) # if the survexfile object is deleted, then all the survex-blocks in it should be too, # though a block can span more than one file... - survexfile = models.ForeignKey("SurvexFile", blank=True, null=True, on_delete=models.CASCADE) + survexfile = models.ForeignKey("SurvexFile", blank=True, null=True, on_delete=models.CASCADE, db_index=True) # survexpath = models.CharField(max_length=200, blank=True, null=True) No need for this anymore scanswallet = models.ForeignKey( |