from sqlalchemy import Column, Integer, String, ForeignKey, DateTime from sqlalchemy.orm import relationship from db.base import Base class Auction(Base): Id = Column(Integer, primary_key=True, index=True) initialPrice = Column(Integer, nullable=False) minimalBet = Column(Integer, nullable=False) carID = Column(Integer, ForeignKey("vehicle.Id"), nullable=False) vehicle = relationship("Vehicle", back_populates="auction") creatorId = Column(Integer, ForeignKey("user.Id"), nullable=False) CreatedBy = relationship("User", back_populates="auctions") dateStart = Column(DateTime, nullable=False) dateEnd = Column(DateTime, nullable=False)