Просмотр исходного кода

Merge pull request #3 from Madiwka4/Madi

Fix
main
Madiwka 1 год назад
committed by GitHub
Родитель
Сommit
580ea7d46f
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4AEE18F83AFDEB23
6 измененных файлов: 9 добавлений и 5 удалений
  1. +1
    -0
      app/db/base.py
  2. +2
    -1
      app/db/models/auction.py
  3. +0
    -0
      app/db/models/fuelingtask.py
  4. +1
    -1
      app/db/models/maintenancejob.py
  5. +3
    -3
      app/db/models/user.py
  6. +2
    -0
      app/db/models/vehicle.py

+ 1
- 0
app/db/base.py Просмотреть файл

@@ -5,3 +5,4 @@ from db.models.vehicle import Vehicle
from db.models.carpart import CarPart
from db.models.maintenancejob import MaintenanceJob
from db.models.drivetask import DriveTask
from db.models.auction import Auction

+ 2
- 1
app/db/models/auction.py Просмотреть файл

@@ -8,8 +8,9 @@ class Auction(Base):
initialPrice = Column(Integer, nullable=False)
minimalBet = Column(Integer, nullable=False)
carID = Column(Integer, ForeignKey("car.Id"), 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)


+ 0
- 0
app/db/models/fuelingtask.py Просмотреть файл


+ 1
- 1
app/db/models/maintenancejob.py Просмотреть файл

@@ -7,7 +7,7 @@ class MaintenanceJob(Base):
Id = Column(Integer, primary_key=True, index=True)
# a list of weak entities of class CarPart
CarParts = relationship("CarPart", back_populates="parent")
CreatedBy = relationship("MaintenancePerson", back_populates="maintenanceJobs")
CreatedBy = relationship("User", back_populates="maintenanceJobs")
Description = Column(String, nullable=False)
Date = Column(DateTime, nullable=False)
MaintenanceWorker = Column(ForeignKey("user.Id"), nullable=False)

+ 3
- 3
app/db/models/user.py Просмотреть файл

@@ -18,14 +18,14 @@ class User(Base):
#Admin-specific relationships
CreatedAuctions = relationship("Auction", back_populates="CreatedBy")
auctions = relationship("Auction", back_populates="CreatedBy")
#Driver-specific relationships
DrivingLicenseNumber = Column(String, nullable=True)
AssignedVehicle = Column(Integer, ForeignKey("vehicle.Id"), nullable=True)
DriveTasks = relationship("DriveTask", back_populates="CreatedBy")
driveTasks = relationship("DriveTask", back_populates="CreatedBy")
vehicle = relationship("Vehicle", back_populates="driver")
#MaintenancePerson-specific relationships
maintenanceJobs = relationship("MaintenanceJob", back_populates="CreatedBy")
#FuelingPerson-specific relationships
fuelingJobs = relationship("FuelingJob", back_populates="CreatedBy")
#fuelingJobs = relationship("FuelingJob", back_populates="CreatedBy")


+ 2
- 0
app/db/models/vehicle.py Просмотреть файл

@@ -22,3 +22,5 @@ class Vehicle(Base):
Capacity = Column(Integer, nullable=False)
DriverHistory = Column(ARRAY(Integer), nullable=True)
driver = relationship("User", back_populates="vehicle")
auction = relationship("Auction", back_populates="vehicle")

Загрузка…
Отмена
Сохранить