Skip to content

Commit a9a5594

Browse files
committed
Surely this will fix everything
1 parent 2dafde3 commit a9a5594

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

src/api/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def validate_points(cls, v: Optional[List[Point]]) -> Optional[List[Point]]:
9595

9696
return v
9797

98-
# 3. Модели запросов через наследование
9998
class CreateZone(ZoneBase):
10099
camera_id: int
101100
zone_type: Literal['parallel', 'standard']

src/db_manager/models.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Camera(Base):
1010

1111
id = Column(Integer, primary_key=True, autoincrement=True)
1212
title = Column(String(120))
13-
is_active = Column(Boolean, default=True)
13+
is_active = Column(Boolean, default=True, index=True)
1414
source = Column(String(250))
1515
image_height = Column(Integer, default=0)
1616
image_width = Column(Integer, default=0)
@@ -22,10 +22,6 @@ class Camera(Base):
2222

2323
parking_zones = relationship("ParkingZone", back_populates="camera")
2424
cars = relationship("Car", back_populates="camera")
25-
26-
__table_args__ = {
27-
Index('ix_camera_active_id', 'is_active', 'id'),
28-
}
2925

3026
def __repr__(self):
3127
return f"<Camera(id={self.id}, title='{self.title}', is_active={self.is_active})>"

0 commit comments

Comments
 (0)