mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-25 18:44:23 +00:00
core: add index on folder and sas properties of SithFile to speed up SAS
This commit is contained in:
parent
ca042fe75e
commit
83e225a744
27
core/migrations/0031_auto_20190906_1615.py
Normal file
27
core/migrations/0031_auto_20190906_1615.py
Normal file
@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.24 on 2019-09-06 14:15
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [("core", "0030_auto_20190704_1500")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="sithfile",
|
||||
name="is_folder",
|
||||
field=models.BooleanField(
|
||||
db_index=True, default=True, verbose_name="is folder"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="sithfile",
|
||||
name="is_in_sas",
|
||||
field=models.BooleanField(
|
||||
db_index=True, default=False, verbose_name="is in the SAS"
|
||||
),
|
||||
),
|
||||
]
|
@ -807,7 +807,7 @@ class SithFile(models.Model):
|
||||
view_groups = models.ManyToManyField(
|
||||
Group, related_name="viewable_files", verbose_name=_("view group"), blank=True
|
||||
)
|
||||
is_folder = models.BooleanField(_("is folder"), default=True)
|
||||
is_folder = models.BooleanField(_("is folder"), default=True, db_index=True)
|
||||
mime_type = models.CharField(_("mime type"), max_length=30)
|
||||
size = models.IntegerField(_("size"), default=0)
|
||||
date = models.DateTimeField(_("date"), default=timezone.now)
|
||||
@ -821,7 +821,7 @@ class SithFile(models.Model):
|
||||
)
|
||||
asked_for_removal = models.BooleanField(_("asked for removal"), default=False)
|
||||
is_in_sas = models.BooleanField(
|
||||
_("is in the SAS"), default=False
|
||||
_("is in the SAS"), default=False, db_index=True
|
||||
) # Allows to query this flag, updated at each call to save()
|
||||
|
||||
class Meta:
|
||||
|
Loading…
Reference in New Issue
Block a user