ad/prisma/schema.prisma

68 lines
1.6 KiB
Plaintext
Raw Normal View History

// 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 = "postgresql"
url = env("DATABASE_URL")
}
model Ad {
2023-05-04 08:05:23 +00:00
uuid String @id @default(uuid()) @db.Uuid
userUuid String @db.Uuid
2023-05-11 15:42:43 +00:00
driver Boolean
passenger Boolean
frequency Frequency
2023-05-04 08:05:23 +00:00
fromDate DateTime @db.Date
toDate DateTime @db.Date
2023-05-15 15:00:05 +00:00
monTime String?
tueTime String?
wedTime String?
thuTime String?
friTime String?
satTime String?
sunTime String?
monMargin Int
tueMargin Int
wedMargin Int
thuMargin Int
friMargin Int
satMargin Int
sunMargin Int
seatsDriver Int @db.SmallInt
seatsPassenger Int @db.SmallInt
2023-05-11 15:42:43 +00:00
strict Boolean
2023-05-04 08:05:23 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
addresses Address[]
@@map("ad")
}
model Address {
2023-05-11 15:42:43 +00:00
uuid String @id @default(uuid()) @db.Uuid
adUuid String @db.Uuid
position Int @db.SmallInt
lon Float
lat Float
2023-05-10 12:37:00 +00:00
name String?
houseNumber String?
street String?
locality String?
postalCode String?
2023-05-11 15:42:43 +00:00
country String
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
Ad Ad @relation(fields: [adUuid], references: [uuid], onDelete: Cascade)
@@map("address")
}
enum Frequency {
PUNCTUAL
RECURRENT
}