Document indexes and make them opt-in (#205)

This commit is contained in:
Sebastián Ramírez
2021-12-28 11:48:03 +01:00
committed by GitHub
parent 3d7b74746c
commit 155c6178cd
91 changed files with 1755 additions and 142 deletions

View File

@ -18,7 +18,7 @@ class HeroTeamLink(SQLModel, table=True):
class Team(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
name: str = Field(index=True)
headquarters: str
hero_links: List[HeroTeamLink] = Relationship(back_populates="team")
@ -26,9 +26,9 @@ class Team(SQLModel, table=True):
class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
name: str = Field(index=True)
secret_name: str
age: Optional[int] = None
age: Optional[int] = Field(default=None, index=True)
team_links: List[HeroTeamLink] = Relationship(back_populates="hero")