make a few columns in the listing model indices to help with search
This commit is contained in:
parent
92c8403157
commit
5adffc8dcf
3 changed files with 58 additions and 5 deletions
|
|
@ -55,9 +55,9 @@ class ListingSite(enum.StrEnum):
|
|||
|
||||
class Listing(SQLModel, table=False):
|
||||
id: int = Field(primary_key=True)
|
||||
price: float = Field(nullable=False)
|
||||
number_of_bedrooms: int = Field(nullable=False)
|
||||
square_meters: float | None = Field(default=None, nullable=True)
|
||||
price: float = Field(nullable=False, index=True)
|
||||
number_of_bedrooms: int = Field(nullable=False, index=True)
|
||||
square_meters: float | None = Field(default=None, nullable=True, index=True)
|
||||
agency: str | None = Field(default=None, nullable=True)
|
||||
council_tax_band: str | None = Field(default=None, nullable=True)
|
||||
longtitude: float = Field(nullable=False)
|
||||
|
|
@ -65,7 +65,9 @@ class Listing(SQLModel, table=False):
|
|||
# price_history: List[Dict[str, Any]] = Field(default_factory=list, sa_type=JSON)
|
||||
price_history_json: str = Field(sa_type=TEXT)
|
||||
listing_site: ListingSite = Field(nullable=False)
|
||||
last_seen: datetime = Field(default_factory=datetime.now, nullable=False)
|
||||
last_seen: datetime = Field(
|
||||
default_factory=datetime.now, nullable=False, index=True
|
||||
)
|
||||
photo_thumbnail: str | None = Field(default=None, nullable=True)
|
||||
floorplan_image_paths: List[str] = Field(
|
||||
default_factory=list, sa_type=JSON, nullable=False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue