Merged with main

This commit is contained in:
Alex van Andel committed 2021-06-20 17:52:18 +00:00
commit f99729c392
24 files changed
+603 -119

No files matched your search

@@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE "SelectedCalendar" (
"userId" INTEGER NOT NULL,
"integration" TEXT NOT NULL,
"externalId" TEXT NOT NULL,
PRIMARY KEY ("userId","integration","externalId")
);
-- AddForeignKey
ALTER TABLE "SelectedCalendar" ADD FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "EventType" ADD COLUMN "eventName" TEXT;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "users" ADD COLUMN "bufferTime" INTEGER NOT NULL DEFAULT 0;
@@ -0,0 +1,20 @@
-- AlterTable
ALTER TABLE "users" ADD COLUMN "emailVerified" TIMESTAMP(3);
-- CreateTable
CREATE TABLE "VerificationRequest" (
"id" SERIAL NOT NULL,
"identifier" TEXT NOT NULL,
"token" TEXT NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "VerificationRequest.token_unique" ON "VerificationRequest"("token");
-- CreateIndex
CREATE UNIQUE INDEX "VerificationRequest.identifier_token_unique" ON "VerificationRequest"("identifier", "token");
+11
View File
@@ -22,6 +22,7 @@ model EventType {
userId Int?
bookings Booking[]
availability Schedule[]
eventName String?
}
model Credential {
@@ -45,12 +46,14 @@ model User {
weekStart String? @default("Sunday")
startTime Int @default(0)
endTime Int @default(1440)
bufferTime Int @default(0)
createdDate DateTime @default(now()) @map(name: "created")
eventTypes EventType[]
credentials Credential[]
teams Membership[]
bookings Booking[]
availability Schedule[]
selectedCalendars SelectedCalendar[]
@@map(name: "users")
}
@@ -137,3 +140,11 @@ model Schedule {
length Int
isOverride Boolean @default(false)
}
model SelectedCalendar {
user User @relation(fields: [userId], references: [id])
userId Int
integration String
externalId String
@@id([userId,integration,externalId])
}