Pārlūkot izejas kodu

Merge pull request #3 from Madiwka4/Madi

Fix
main
Madiwka pirms 1 gada
committed by GitHub
vecāks
revīzija
580ea7d46f
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
6 mainītis faili ar 9 papildinājumiem un 5 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu


+ 1
- 1
app/db/models/maintenancejob.py Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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")

Notiek ielāde…
Atcelt
Saglabāt