Add indexes

This commit is contained in:
2022-01-03 12:40:58 +03:00
parent 017cc05a19
commit 8188d23405
2 changed files with 29 additions and 2 deletions

View File

@@ -143,8 +143,10 @@ class Book(ormar.Model):
title: str = ormar.String(
max_length=256, nullable=False, index=True
) # type: ignore
lang: str = ormar.String(max_length=3, nullable=False) # type: ignore
file_type: str = ormar.String(max_length=4, nullable=False) # type: ignore
lang: str = ormar.String(max_length=3, nullable=False, index=True) # type: ignore
file_type: str = ormar.String(
max_length=4, nullable=False, index=True
) # type: ignore
uploaded: date = ormar.Date() # type: ignore
is_deleted: bool = ormar.Boolean(
default=False, server_default=text("false"), nullable=False