17 lines
476 B
Python
17 lines
476 B
Python
from sqlalchemy import Column, Integer, VARCHAR, Float
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.infrastructure.database.models import Base
|
|
|
|
|
|
class Truck(Base):
|
|
__tablename__ = 'trucks'
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
name = Column(VARCHAR(100), nullable=False)
|
|
capacity = Column(Float, nullable=False)
|
|
volume = Column(Float, nullable=False)
|
|
|
|
delivery_orders = relationship('DeliveryOrder', back_populates='truck')
|
|
|