From bcf20914d300dfa635b1ae0f01b4f34d4443f5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20L=C3=B3pez?= Date: Sun, 10 Oct 2021 11:48:21 -0600 Subject: [PATCH] Makes fields with default values non-optional (#892) --- prisma/schema.prisma | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ffe55f7ccb..575b440480 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -16,6 +16,12 @@ enum SchedulingType { COLLECTIVE @map("collective") } +enum PeriodType { + unlimited + rolling + range +} + model EventType { id Int @id @default(autoincrement()) title String @@ -33,7 +39,7 @@ model EventType { eventName String? customInputs EventTypeCustomInput[] timeZone String? - periodType String? @default("unlimited") // unlimited | rolling | range + periodType PeriodType @default(unlimited) // unlimited | rolling | range periodStartDate DateTime? periodEndDate DateTime? periodDays Int? @@ -43,8 +49,8 @@ model EventType { minimumBookingNotice Int @default(120) schedulingType SchedulingType? Schedule Schedule[] - price Int @default(0) - currency String @default("usd") + price Int @default(0) + currency String @default("usd") @@unique([userId, slug]) } @@ -66,13 +72,13 @@ model User { id Int @id @default(autoincrement()) username String? @unique name String? - email String? @unique + email String @unique emailVerified DateTime? password String? bio String? avatar String? timeZone String @default("Europe/London") - weekStart String? @default("Sunday") + weekStart String @default("Sunday") startTime Int @default(0) endTime Int @default(1440) bufferTime Int @default(0) @@ -85,7 +91,7 @@ model User { bookings Booking[] availability Availability[] selectedCalendars SelectedCalendar[] - completedOnboarding Boolean? @default(false) + completedOnboarding Boolean @default(false) locale String? twoFactorSecret String? twoFactorEnabled Boolean @default(false)