From a59100b23138a1772909830bf86c7ee84bac4690 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 30 Apr 2015 15:56:40 -0400 Subject: [PATCH] Add the missing index on the peewee side. We already have the associated migration. --- data/database.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/database.py b/data/database.py index d1c701c70..6caae2d73 100644 --- a/data/database.py +++ b/data/database.py @@ -561,6 +561,14 @@ class LogEntry(BaseModel): ip = CharField(null=True) metadata_json = TextField(default='{}') + class Meta: + database = db + read_slaves = (read_slave,) + indexes = ( + # create an index on repository and date + (('repository', 'datetime'), False), + ) + class RepositoryActionCount(BaseModel): repository = ForeignKeyField(Repository, index=True)