Index the document checksum field for faster searches by checksum.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-07-05 15:43:27 -04:00
parent 0820d0c0e6
commit 2ec939e595
3 changed files with 26 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ Other Changes
document types from either the metadata type list or document type list.
GitLab issue #373.
- Add support to search documents by their checksums.
- The document checksum field is now indexed for faster searches by checksum.
Removals
--------

View File

@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-05 19:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0037_auto_20161231_0617'),
]
operations = [
migrations.AlterField(
model_name='documentversion',
name='checksum',
field=models.TextField(
blank=True, db_index=True, editable=False, null=True,
verbose_name='Checksum'
),
),
]

View File

@@ -383,7 +383,8 @@ class DocumentVersion(models.Model):
blank=True, editable=False, max_length=64, null=True
)
checksum = models.TextField(
blank=True, editable=False, null=True, verbose_name=_('Checksum')
blank=True, db_index=True, editable=False, null=True,
verbose_name=_('Checksum')
)
def __str__(self):