building a foundation and breaking prisma

Co-authored-by: Spacelord <Spacelord09@users.noreply.github.com>
This commit is contained in:
2023-04-30 22:04:13 +02:00
commit 18a4393765
18 changed files with 2717 additions and 0 deletions

60
prisma/schema.prisma Normal file
View File

@ -0,0 +1,60 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
enum Category {
Light
Audio
Laptop
Adapter
Other
}
enum Status {
normal
borrowed
stolen
lost
}
model Item {
id Int @id @default(autoincrement())
SKU String @unique
Amount Int
Comment String?
name String
manufacturer String
category Category
status Status
StorageLocation StorageLocation @relation(fields: [storageLocationId], references: [id])
storageLocationId Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model StorageLocation {
id Int @id @default(autoincrement())
name String
storageBuilding StorageBuilding @relation(fields: [storageBuildingId], references: [id])
storageBuildingId Int
Item Item[]
}
model StorageBuilding {
id Int @id @default(autoincrement())
name String
street String
houseNumber String
zipCode String
city String
country String
StorageLocation StorageLocation[]
}