From ee603a0a27fbbcfad51baeb71b3c34a8a61abfc9 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Wed, 30 Jun 2021 01:48:23 +0000 Subject: [PATCH] Added migration for Availability and related --- .../migration.sql | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 prisma/migrations/20210630014738_schedule_availability/migration.sql diff --git a/prisma/migrations/20210630014738_schedule_availability/migration.sql b/prisma/migrations/20210630014738_schedule_availability/migration.sql new file mode 100644 index 00000000..a5099595 --- /dev/null +++ b/prisma/migrations/20210630014738_schedule_availability/migration.sql @@ -0,0 +1,31 @@ +/* + Warnings: + + - You are about to drop the `ResetPasswordRequest` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- AlterTable +ALTER TABLE "EventType" ADD COLUMN "timeZone" TEXT; + +-- DropTable +DROP TABLE "ResetPasswordRequest"; + +-- CreateTable +CREATE TABLE "Availability" ( + "id" SERIAL NOT NULL, + "label" TEXT, + "userId" INTEGER, + "eventTypeId" INTEGER, + "days" INTEGER[], + "startTime" INTEGER NOT NULL, + "endTime" INTEGER NOT NULL, + "date" DATE, + + PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "Availability" ADD FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Availability" ADD FOREIGN KEY ("eventTypeId") REFERENCES "EventType"("id") ON DELETE SET NULL ON UPDATE CASCADE;