From c407d26e8b3d3b82fdf14e432d8491337ab90bad Mon Sep 17 00:00:00 2001 From: Tim Howitz Date: Mon, 19 May 2025 12:51:46 +0100 Subject: [PATCH] Modified Artefact and added Pallet models --- prisma/schema.prisma | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index c7a2f1f..82a1bf7 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -94,18 +94,29 @@ model Observatory { // Artefact model model Artefact { - id Int @id @default(autoincrement()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - type String @db.VarChar(50) // Lava, Tephra, Ash, Soil - warehouseArea String // Examples: "ZoneA-Shelf1", "ZoneB-Rack2", "ZoneC-Bin3" - earthquakeId Int - earthquake Earthquake @relation(fields: [earthquakeId], references: [id]) - creatorId Int? - creator Scientist? @relation("ScientistArtefactCreator", fields: [creatorId], references: [id], onDelete: NoAction, onUpdate: NoAction) - required Boolean @default(true) - shopPrice Float? // In Euros - purchasedById Int? - purchasedBy User? @relation("UserPurchasedArtefacts", fields: [purchasedById], references: [id], onDelete: NoAction, onUpdate: NoAction) - pickedUp Boolean @default(false) + id Int @id @default(autoincrement()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + type String @db.VarChar(50) // Lava, Tephra, Ash, Soil + warehouseArea String // Examples: "ZoneA-Shelf1", "ZoneB-Rack2", "ZoneC-Bin3" + description String + earthquakeId Int + earthquake Earthquake @relation(fields: [earthquakeId], references: [id]) + creatorId Int? + creator Scientist? @relation("ScientistArtefactCreator", fields: [creatorId], references: [id], onDelete: NoAction, onUpdate: NoAction) + required Boolean @default(true) + dateAddedToShop DateTime? + shopPrice Float? // In Euros + 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 }