Modified Artefact and added Pallet models

This commit is contained in:
Tim Howitz 2025-05-19 12:51:46 +01:00
parent 376f6500d5
commit c407d26e8b

View File

@ -94,18 +94,29 @@ model Observatory {
// Artefact model // Artefact model
model Artefact { model Artefact {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
type String @db.VarChar(50) // Lava, Tephra, Ash, Soil type String @db.VarChar(50) // Lava, Tephra, Ash, Soil
warehouseArea String // Examples: "ZoneA-Shelf1", "ZoneB-Rack2", "ZoneC-Bin3" warehouseArea String // Examples: "ZoneA-Shelf1", "ZoneB-Rack2", "ZoneC-Bin3"
earthquakeId Int description String
earthquake Earthquake @relation(fields: [earthquakeId], references: [id]) earthquakeId Int
creatorId Int? earthquake Earthquake @relation(fields: [earthquakeId], references: [id])
creator Scientist? @relation("ScientistArtefactCreator", fields: [creatorId], references: [id], onDelete: NoAction, onUpdate: NoAction) creatorId Int?
required Boolean @default(true) creator Scientist? @relation("ScientistArtefactCreator", fields: [creatorId], references: [id], onDelete: NoAction, onUpdate: NoAction)
shopPrice Float? // In Euros required Boolean @default(true)
purchasedById Int? dateAddedToShop DateTime?
purchasedBy User? @relation("UserPurchasedArtefacts", fields: [purchasedById], references: [id], onDelete: NoAction, onUpdate: NoAction) shopPrice Float? // In Euros
pickedUp Boolean @default(false) purchased Boolean @default(false)
purchasedById Int?
purchasedBy User? @relation("UserPurchasedArtefacts", fields: [purchasedById], references: [id], onDelete: NoAction, onUpdate: NoAction)
pickedUp Boolean @default(false)
}
model Pallet {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
warehouseArea String // Examples: "ZoneA-Shelf1", "ZoneB-Rack2", "ZoneC-Bin3"
palletNote String
} }