calcom/packages/prisma/migrations/20210908042159_teams_feature/migration.sql
Omar López fe35cf6570
Extract prisma to it's own package (#1823)
* Moved prisma to packages

* Add missing prisma configs

* Extracts common libs and types

* Build and pipeline fixes

* Adds missing package

* Prisma scripts cleanup

* Updates lint staged

* Type fixes

* Sort imports

* Updates yarn lock file

* Fixes for yarn dx

* Revert "Sort imports"

This reverts commit 076109decab9b9ba307fc03696c3b0da5c4896f3.

* Formatting

* Prevent double TS version

* Fix conflict

* Extracted e2e configs
2022-02-15 13:30:52 -07:00

30 lines
967 B
SQL

-- CreateEnum
CREATE TYPE "SchedulingType" AS ENUM ('roundRobin', 'collective');
-- DropForeignKey
ALTER TABLE "EventType" DROP CONSTRAINT "EventType_userId_fkey";
-- AlterTable
ALTER TABLE "EventType" ADD COLUMN "schedulingType" "SchedulingType",
ADD COLUMN "teamId" INTEGER;
-- CreateTable
CREATE TABLE "_user_eventtype" (
"A" INTEGER NOT NULL,
"B" INTEGER NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "_user_eventtype_AB_unique" ON "_user_eventtype"("A", "B");
-- CreateIndex
CREATE INDEX "_user_eventtype_B_index" ON "_user_eventtype"("B");
-- AddForeignKey
ALTER TABLE "EventType" ADD FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_user_eventtype" ADD FOREIGN KEY ("A") REFERENCES "EventType"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_user_eventtype" ADD FOREIGN KEY ("B") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;