diff --git a/wagtail/wagtailcore/migrations/0020_add_index_on_page_first_published_at.py b/wagtail/wagtailcore/migrations/0020_add_index_on_page_first_published_at.py new file mode 100644 index 000000000..87ad61fb3 --- /dev/null +++ b/wagtail/wagtailcore/migrations/0020_add_index_on_page_first_published_at.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0019_verbose_names_cleanup'), + ] + + operations = [ + migrations.AlterField( + model_name='page', + name='first_published_at', + field=models.DateTimeField(editable=False, null=True, verbose_name='First published at', db_index=True), + ), + ] diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index e535bd436..ccdafbcab 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -239,7 +239,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed locked = models.BooleanField(verbose_name=_('Locked'), default=False, editable=False) - first_published_at = models.DateTimeField(verbose_name=_('First published at'), null=True, editable=False) + first_published_at = models.DateTimeField(verbose_name=_('First published at'), null=True, editable=False, db_index=True) latest_revision_created_at = models.DateTimeField(verbose_name=_('Latest revision created at'), null=True, editable=False) search_fields = (