add: parse depth proto

v0.4
rrr-marble 3 years ago
parent 9b2313621c
commit 6b172ebc8b

@ -1,4 +1,4 @@
from sqlalchemy import Column, Computed, DateTime, Index, Integer, String from sqlalchemy import Column, Computed, DateTime, Float, Index, Integer, String
# we might need vector concat later, then we'll have to bring in sqlalchemy_utils # we might need vector concat later, then we'll have to bring in sqlalchemy_utils
# https://sqlalchemy-utils.readthedocs.io/en/latest/_modules/sqlalchemy_utils/types/ts_vector.html # https://sqlalchemy-utils.readthedocs.io/en/latest/_modules/sqlalchemy_utils/types/ts_vector.html
@ -48,6 +48,8 @@ class ItemCreate(ItemBase):
class Item(ItemBase): class Item(ItemBase):
depth_min = Column(Float, Computed("SPLIT_PART(depth,'-',1)"))
depth_max = Column(Float, Computed("SPLIT_PART(depth,'-',2)"))
geodata_search_ts = Column( geodata_search_ts = Column(
TSVECTOR, TSVECTOR,

@ -58,6 +58,9 @@ class ItemCreate(ItemBase):
class Item(ItemBase): class Item(ItemBase):
id: int id: int
depth_min: Optional[float] = None
depth_max: Optional[float] = None
class Config: class Config:
orm_mode = True orm_mode = True

Loading…
Cancel
Save