92 lines
2.1 KiB
Plaintext
92 lines
2.1 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Vehicle {
|
|
id Int @id @default(autoincrement())
|
|
brand String
|
|
model String
|
|
variant String?
|
|
year Int
|
|
kilometers Int
|
|
condition String
|
|
location String
|
|
latitude String
|
|
longitude String
|
|
gasType String
|
|
images String[]
|
|
description String
|
|
service String
|
|
inspectedAt DateTime?
|
|
|
|
updatedAt DateTime @updatedAt
|
|
createdAt DateTime @default(now())
|
|
|
|
auctions Auction[] // Relation to Auction
|
|
equipment Equipment[] @relation("VehicleEquipment")
|
|
}
|
|
|
|
model Equipment {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
|
|
vehicles Vehicle[] @relation("VehicleEquipment")
|
|
}
|
|
|
|
model Auction {
|
|
id Int @id @default(autoincrement())
|
|
vehicleId Int
|
|
userId Int
|
|
|
|
askingPrice Float
|
|
description String?
|
|
|
|
vehicle Vehicle @relation(fields: [vehicleId], references: [id])
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
updatedAt DateTime @updatedAt
|
|
createdAt DateTime @default(now())
|
|
|
|
bids Bid[] // Relation to Bid
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
company String?
|
|
address String
|
|
latitude String
|
|
longitude String
|
|
phone String
|
|
privatePhone String?
|
|
email String
|
|
cvr String?
|
|
|
|
updatedAt DateTime @updatedAt
|
|
createdAt DateTime @default(now())
|
|
|
|
auctions Auction[] // Relation to Auction
|
|
}
|
|
|
|
model Bid {
|
|
id Int @id @default(autoincrement())
|
|
auctionId Int
|
|
bid Float
|
|
|
|
auction Auction @relation(fields: [auctionId], references: [id])
|
|
|
|
updatedAt DateTime @updatedAt
|
|
createdAt DateTime @default(now())
|
|
}
|