Makes fields with default values not null (#903)
* Makes fields with default values non-optional * Removes PeriodType enum for now * Adds missing migrations Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
This commit is contained in:
parent
c3dc18643e
commit
a73187d46b
2 changed files with 22 additions and 6 deletions
16
prisma/migrations/20211011152041_non_optionals/migration.sql
Normal file
16
prisma/migrations/20211011152041_non_optionals/migration.sql
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- Made the column `periodType` on table `EventType` required. This step will fail if there are existing NULL values in that column.
|
||||||
|
- Made the column `email` on table `users` required. This step will fail if there are existing NULL values in that column.
|
||||||
|
- Made the column `weekStart` on table `users` required. This step will fail if there are existing NULL values in that column.
|
||||||
|
- Made the column `completedOnboarding` on table `users` required. This step will fail if there are existing NULL values in that column.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "EventType" ALTER COLUMN "periodType" SET NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "users" ALTER COLUMN "email" SET NOT NULL,
|
||||||
|
ALTER COLUMN "weekStart" SET NOT NULL,
|
||||||
|
ALTER COLUMN "completedOnboarding" SET NOT NULL;
|
|
@ -33,7 +33,7 @@ model EventType {
|
||||||
eventName String?
|
eventName String?
|
||||||
customInputs EventTypeCustomInput[]
|
customInputs EventTypeCustomInput[]
|
||||||
timeZone String?
|
timeZone String?
|
||||||
periodType String? @default("unlimited") // unlimited | rolling | range
|
periodType String @default("unlimited") // unlimited | rolling | range
|
||||||
periodStartDate DateTime?
|
periodStartDate DateTime?
|
||||||
periodEndDate DateTime?
|
periodEndDate DateTime?
|
||||||
periodDays Int?
|
periodDays Int?
|
||||||
|
@ -43,8 +43,8 @@ model EventType {
|
||||||
minimumBookingNotice Int @default(120)
|
minimumBookingNotice Int @default(120)
|
||||||
schedulingType SchedulingType?
|
schedulingType SchedulingType?
|
||||||
Schedule Schedule[]
|
Schedule Schedule[]
|
||||||
price Int @default(0)
|
price Int @default(0)
|
||||||
currency String @default("usd")
|
currency String @default("usd")
|
||||||
@@unique([userId, slug])
|
@@unique([userId, slug])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,13 +66,13 @@ model User {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
username String? @unique
|
username String? @unique
|
||||||
name String?
|
name String?
|
||||||
email String? @unique
|
email String @unique
|
||||||
emailVerified DateTime?
|
emailVerified DateTime?
|
||||||
password String?
|
password String?
|
||||||
bio String?
|
bio String?
|
||||||
avatar String?
|
avatar String?
|
||||||
timeZone String @default("Europe/London")
|
timeZone String @default("Europe/London")
|
||||||
weekStart String? @default("Sunday")
|
weekStart String @default("Sunday")
|
||||||
startTime Int @default(0)
|
startTime Int @default(0)
|
||||||
endTime Int @default(1440)
|
endTime Int @default(1440)
|
||||||
bufferTime Int @default(0)
|
bufferTime Int @default(0)
|
||||||
|
@ -85,7 +85,7 @@ model User {
|
||||||
bookings Booking[]
|
bookings Booking[]
|
||||||
availability Availability[]
|
availability Availability[]
|
||||||
selectedCalendars SelectedCalendar[]
|
selectedCalendars SelectedCalendar[]
|
||||||
completedOnboarding Boolean? @default(false)
|
completedOnboarding Boolean @default(false)
|
||||||
locale String?
|
locale String?
|
||||||
twoFactorSecret String?
|
twoFactorSecret String?
|
||||||
twoFactorEnabled Boolean @default(false)
|
twoFactorEnabled Boolean @default(false)
|
||||||
|
|
Loading…
Reference in a new issue