##// END OF EJS Templates
Added indexes on frequently used fields
neko259 -
r1667:9955a8b6 default
parent child Browse files
Show More
@@ -0,0 +1,25 b''
1 # -*- coding: utf-8 -*-
2 # Generated by Django 1.9.5 on 2016-10-13 07:37
3 from __future__ import unicode_literals
4
5 from django.db import migrations, models
6
7
8 class Migration(migrations.Migration):
9
10 dependencies = [
11 ('boards', '0050_auto_20161008_1745'),
12 ]
13
14 operations = [
15 migrations.AlterField(
16 model_name='post',
17 name='pub_time',
18 field=models.DateTimeField(db_index=True),
19 ),
20 migrations.AlterField(
21 model_name='thread',
22 name='status',
23 field=models.CharField(choices=[('active', 'active'), ('bumplimit', 'bumplimit'), ('archived', 'archived')], db_index=True, default='active', max_length=50),
24 ),
25 ]
@@ -70,7 +70,7 b' class Post(models.Model, Viewable):'
70 ordering = ('id',)
70 ordering = ('id',)
71
71
72 title = models.CharField(max_length=TITLE_MAX_LENGTH, null=True, blank=True)
72 title = models.CharField(max_length=TITLE_MAX_LENGTH, null=True, blank=True)
73 pub_time = models.DateTimeField()
73 pub_time = models.DateTimeField(db_index=True)
74 text = TextField(blank=True, null=True)
74 text = TextField(blank=True, null=True)
75 _text_rendered = TextField(blank=True, null=True, editable=False)
75 _text_rendered = TextField(blank=True, null=True, editable=False)
76
76
@@ -98,7 +98,7 b' class Thread(models.Model):'
98 last_edit_time = models.DateTimeField()
98 last_edit_time = models.DateTimeField()
99 max_posts = models.IntegerField(default=get_thread_max_posts)
99 max_posts = models.IntegerField(default=get_thread_max_posts)
100 status = models.CharField(max_length=50, default=STATUS_ACTIVE,
100 status = models.CharField(max_length=50, default=STATUS_ACTIVE,
101 choices=STATUS_CHOICES)
101 choices=STATUS_CHOICES, db_index=True)
102 monochrome = models.BooleanField(default=False)
102 monochrome = models.BooleanField(default=False)
103
103
104 def get_tags(self) -> QuerySet:
104 def get_tags(self) -> QuerySet:
General Comments 0
You need to be logged in to leave comments. Login now