Index the is_stub and is_deleted document boolean fields.
This commit is contained in:
24
mayan/apps/documents/migrations/0034_auto_20160509_2321.py
Normal file
24
mayan/apps/documents/migrations/0034_auto_20160509_2321.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('documents', '0033_auto_20160325_0052'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='document',
|
||||
name='in_trash',
|
||||
field=models.BooleanField(default=False, verbose_name='In trash?', db_index=True, editable=False),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='document',
|
||||
name='is_stub',
|
||||
field=models.BooleanField(default=True, editable=False, help_text='A document stub is a document with an entry on the database but no file uploaded. This could be an interrupted upload or a deferred upload via the API.', verbose_name='Is stub?', db_index=True),
|
||||
),
|
||||
]
|
||||
@@ -169,7 +169,8 @@ class Document(models.Model):
|
||||
verbose_name=_('Language')
|
||||
)
|
||||
in_trash = models.BooleanField(
|
||||
default=False, editable=False, verbose_name=_('In trash?')
|
||||
db_index=True, default=False, editable=False,
|
||||
verbose_name=_('In trash?')
|
||||
)
|
||||
# TODO: set editable to False
|
||||
deleted_date_time = models.DateTimeField(
|
||||
@@ -177,10 +178,11 @@ class Document(models.Model):
|
||||
verbose_name=_('Date and time trashed')
|
||||
)
|
||||
is_stub = models.BooleanField(
|
||||
default=True, editable=False, help_text=_(
|
||||
db_index=True, default=True, editable=False, help_text=_(
|
||||
'A document stub is a document with an entry on the database but '
|
||||
'no file uploaded. This could be an interrupted upload or a '
|
||||
'deferred upload via the API.'), verbose_name=_('Is stub?')
|
||||
'deferred upload via the API.'
|
||||
), verbose_name=_('Is stub?')
|
||||
)
|
||||
|
||||
objects = DocumentManager()
|
||||
|
||||
Reference in New Issue
Block a user