add some Catalog field indexes

This commit is contained in:
Seth Ladygo
2019-04-23 17:03:00 -07:00
parent 32ed1a8712
commit 950bc21d87
2 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,23 @@
# Generated by Django 2.2 on 2019-04-24 00:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('procat2', '0003_auto_20190423_2203'),
]
operations = [
migrations.AlterField(
model_name='catalog',
name='public',
field=models.BooleanField(db_index=True, default=False),
),
migrations.AlterField(
model_name='catalog',
name='updated',
field=models.DateTimeField(auto_now=True, db_index=True),
),
]

View File

@ -21,9 +21,9 @@ class Catalog(models.Model):
season = models.ForeignKey(Season, on_delete=models.PROTECT)
region = models.ForeignKey(Region, on_delete=models.PROTECT)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
updated = models.DateTimeField(auto_now=True, db_index=True)
name = models.CharField(max_length=300)
public = models.BooleanField(default=False)
public = models.BooleanField(default=False, db_index=True)
pages = models.PositiveIntegerField(default=0)
sections = models.PositiveIntegerField(default=0)
materials = models.PositiveIntegerField(default=0)