assetflow/prisma/schema.prisma
Spacelord 3569c9ed4b Updated styles and Added storageManager.
- Dark/White-mode support
- Collapsible navs
- Renamed items template.
- StorageBuilding's are now StorageUnit's
- Formatting, general cleanup, some bug fixing.
2023-05-13 00:06:35 +02:00

77 lines
1.9 KiB
Plaintext

// 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")
}
// https://github.com/pantharshit00/prisma-docs-generator
generator docs {
provider = "node node_modules/prisma-docs-generator"
output = "../docs"
}
// https://github.com/notiz-dev/prisma-dbml-generator
// Viewer: https://dbdiagram.io/d
generator dbml {
provider = "prisma-dbml-generator"
output = "../docs"
outputName = "schema.dbml"
projectName = "AssetFlow"
}
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 @relation(fields: [categoryId], references: [id])
categoryId Int
status Status
StorageLocation StorageLocation? @relation(fields: [storageLocationId], references: [id])
storageLocationId Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
importedBy String?
}
model StorageLocation {
id Int @id @default(autoincrement())
name String @unique
storageUnit StorageUnit? @relation(fields: [storageUnitId], references: [id])
storageUnitId Int?
Item Item[]
}
model StorageUnit {
id Int @id @default(autoincrement())
name String
street String
houseNumber String
zipCode String
city String
country String
StorageLocation StorageLocation[]
}
model Category {
id Int @id @default(autoincrement())
name String @unique
description String?
Item Item[]
}