-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.prisma
69 lines (55 loc) · 2.02 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// 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 User {
id String @id @default(uuid())
// Personal Information
fullName String @map("full_name")
email String @unique
phoneNumber String @unique
// Property Information
propertyAddress String? @map("property_address")
propertyType String? @map("property_type")
squareFootage Int? @map("square_footage")
// Relations
sessions Session[]
@@map("users")
}
model Contractor {
id String @id @default(uuid())
phoneNumber String @unique
name String
email String @unique
experience Int // Years of experience
location String // Service area/location
specialty String[] // Array of specialties
sessions Session[] // Relation to sessions
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("contractors")
}
model Session {
id String @id @default(uuid())
propertyAddress String @map("property_address")
propertyType String @map("property_type")
squareFootage Int @map("square_footage")
appointmentTime DateTime @map("appointment_time")
// Customer information
userId String @map("user_id")
user User @relation(fields: [userId], references: [id])
// Contractor information
contractorId String @map("contractor_id")
contractor Contractor @relation(fields: [contractorId], references: [id])
createdAt DateTime @default(now()) @map("created_at")
calEventId String? @map("cal_event_id")
status String @default("scheduled")
@@map("sessions")
}