From b5e7e8dbc55fce23e5b9e4143fd242b09aabeb22 Mon Sep 17 00:00:00 2001 From: JOY <5027251+JOY@users.noreply.github.com> Date: Sat, 22 Aug 2026 11:09:46 +0700 Subject: [PATCH 1/3] fix(prisma): remove hardcoded public schema prefix from migrations to support custom schema Co-authored-by: Cursor --- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 6 +- .../migration.sql | 2 +- .../migration.sql | 10 +- .../migration.sql | 2 +- .../migration.sql | 10 +- .../migration.sql | 4 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 4 +- .../migration.sql | 2 +- .../migration.sql | 38 +++--- .../migration.sql | 2 +- .../migration.sql | 12 +- .../migration.sql | 6 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 6 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 6 +- .../migration.sql | 8 +- .../migration.sql | 14 +-- .../migration.sql | 6 +- .../migration.sql | 4 +- .../migration.sql | 12 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 4 +- .../migration.sql | 46 +++---- .../migration.sql | 2 +- .../migration.sql | 22 ++-- .../migration.sql | 2 +- .../migration.sql | 10 +- .../migration.sql | 4 +- .../migration.sql | 2 +- .../migration.sql | 14 +-- .../migration.sql | 2 +- .../migration.sql | 4 +- .../migration.sql | 2 +- .../migration.sql | 12 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 32 ++--- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 26 ++-- .../migration.sql | 6 +- .../migration.sql | 2 +- .../migration.sql | 2 +- .../migration.sql | 112 +++++++++--------- .../migration.sql | 20 ++-- 61 files changed, 262 insertions(+), 262 deletions(-) diff --git a/packages/prisma/migrations/20230418002117_booking_time_status/migration.sql b/packages/prisma/migrations/20230418002117_booking_time_status/migration.sql index 5c628d044e1989..181592ab96c9a6 100644 --- a/packages/prisma/migrations/20230418002117_booking_time_status/migration.sql +++ b/packages/prisma/migrations/20230418002117_booking_time_status/migration.sql @@ -2,7 +2,7 @@ -- DROP VIEW public."BookingsTimeStatus"; -CREATE OR REPLACE VIEW public."BookingTimeStatus" +CREATE OR REPLACE VIEW "BookingTimeStatus" AS SELECT "Booking".id, "Booking".uid, diff --git a/packages/prisma/migrations/20230719214513_update_booking_time_status_fields_event_parent_id/migration.sql b/packages/prisma/migrations/20230719214513_update_booking_time_status_fields_event_parent_id/migration.sql index 0d523916549251..66e78206d2b58b 100644 --- a/packages/prisma/migrations/20230719214513_update_booking_time_status_fields_event_parent_id/migration.sql +++ b/packages/prisma/migrations/20230719214513_update_booking_time_status_fields_event_parent_id/migration.sql @@ -2,7 +2,7 @@ -- DROP VIEW public."BookingsTimeStatus"; -CREATE OR REPLACE VIEW public."BookingTimeStatus" +CREATE OR REPLACE VIEW "BookingTimeStatus" AS SELECT "Booking".id, "Booking".uid, diff --git a/packages/prisma/migrations/20230921002822_fix_booking_time_status/migration.sql b/packages/prisma/migrations/20230921002822_fix_booking_time_status/migration.sql index 0fbf5d5e868e64..3eefca6cebfea9 100644 --- a/packages/prisma/migrations/20230921002822_fix_booking_time_status/migration.sql +++ b/packages/prisma/migrations/20230921002822_fix_booking_time_status/migration.sql @@ -2,7 +2,7 @@ -- DROP VIEW public."BookingsTimeStatus"; -CREATE OR REPLACE VIEW public."BookingTimeStatus" +CREATE OR REPLACE VIEW "BookingTimeStatus" AS SELECT "Booking".id, "Booking".uid, diff --git a/packages/prisma/migrations/20231001101010_add_user_email_to_booking_time_status/migration.sql b/packages/prisma/migrations/20231001101010_add_user_email_to_booking_time_status/migration.sql index 38a68f839ad60e..515fa0915c2593 100644 --- a/packages/prisma/migrations/20231001101010_add_user_email_to_booking_time_status/migration.sql +++ b/packages/prisma/migrations/20231001101010_add_user_email_to_booking_time_status/migration.sql @@ -2,7 +2,7 @@ -- DROP VIEW public."BookingTimeStatus"; -CREATE OR REPLACE VIEW public."BookingTimeStatus" +CREATE OR REPLACE VIEW "BookingTimeStatus" AS SELECT "Booking".id, "Booking".uid, diff --git a/packages/prisma/migrations/20240419114622_add_ratings_to_insights/migration.sql b/packages/prisma/migrations/20240419114622_add_ratings_to_insights/migration.sql index 71ccaec2c4b864..fcf163c0282021 100644 --- a/packages/prisma/migrations/20240419114622_add_ratings_to_insights/migration.sql +++ b/packages/prisma/migrations/20240419114622_add_ratings_to_insights/migration.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE VIEW public."BookingTimeStatus" +CREATE OR REPLACE VIEW "BookingTimeStatus" AS SELECT "Booking".id, diff --git a/packages/prisma/migrations/20240909162522_union_insights_data/migration.sql b/packages/prisma/migrations/20240909162522_union_insights_data/migration.sql index 87b9e42030848f..aca92db1b0593e 100644 --- a/packages/prisma/migrations/20240909162522_union_insights_data/migration.sql +++ b/packages/prisma/migrations/20240909162522_union_insights_data/migration.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE VIEW public."BookingTimeStatus" +CREATE OR REPLACE VIEW "BookingTimeStatus" AS SELECT "Booking".id, diff --git a/packages/prisma/migrations/20250505135207_create_booking_time_status_denormalized/migration.sql b/packages/prisma/migrations/20250505135207_create_booking_time_status_denormalized/migration.sql index 693d62a03bd0d6..0c45160b5c4fe4 100644 --- a/packages/prisma/migrations/20250505135207_create_booking_time_status_denormalized/migration.sql +++ b/packages/prisma/migrations/20250505135207_create_booking_time_status_denormalized/migration.sql @@ -1,11 +1,11 @@ -CREATE OR REPLACE VIEW public."BookingTimeStatusDenormalized" AS +CREATE OR REPLACE VIEW "BookingTimeStatusDenormalized" AS SELECT *, CASE WHEN "rescheduled" IS TRUE THEN 'rescheduled' - WHEN "status" = 'cancelled'::public."BookingStatus" AND "rescheduled" IS NULL THEN 'cancelled' + WHEN "status" = 'cancelled'::"BookingStatus" AND "rescheduled" IS NULL THEN 'cancelled' WHEN "endTime" < now() THEN 'completed' WHEN "endTime" > now() THEN 'uncompleted' ELSE NULL END as "timeStatus" -FROM public."BookingDenormalized"; +FROM "BookingDenormalized"; diff --git a/packages/prisma/migrations/20250925122623_add_default_now_eventtype_table_created_at/migration.sql b/packages/prisma/migrations/20250925122623_add_default_now_eventtype_table_created_at/migration.sql index 37d45c08dd8dee..0629323a6d04cc 100644 --- a/packages/prisma/migrations/20250925122623_add_default_now_eventtype_table_created_at/migration.sql +++ b/packages/prisma/migrations/20250925122623_add_default_now_eventtype_table_created_at/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."EventType" ALTER COLUMN "createdAt" SET DEFAULT CURRENT_TIMESTAMP; +ALTER TABLE "EventType" ALTER COLUMN "createdAt" SET DEFAULT CURRENT_TIMESTAMP; diff --git a/packages/prisma/migrations/20251023133244_add_user_uuid_column/migration.sql b/packages/prisma/migrations/20251023133244_add_user_uuid_column/migration.sql index f59a6784a2d377..ca922522772e9c 100644 --- a/packages/prisma/migrations/20251023133244_add_user_uuid_column/migration.sql +++ b/packages/prisma/migrations/20251023133244_add_user_uuid_column/migration.sql @@ -5,10 +5,10 @@ */ -- AlterTable -ALTER TABLE "public"."users" ADD COLUMN "uuid" UUID; +ALTER TABLE "users" ADD COLUMN "uuid" UUID; -- CreateIndex -CREATE UNIQUE INDEX "users_uuid_key" ON "public"."users"("uuid"); +CREATE UNIQUE INDEX "users_uuid_key" ON "users"("uuid"); -- Backfill UUIDs in batches to avoid table locking on large datasets -- Uses FOR UPDATE SKIP LOCKED to prevent blocking other transactions @@ -22,15 +22,15 @@ BEGIN LOOP WITH batch AS ( SELECT id - FROM "public"."users" + FROM "users" WHERE uuid IS NULL LIMIT batch_size FOR UPDATE SKIP LOCKED ) - UPDATE "public"."users" + UPDATE "users" SET uuid = gen_random_uuid() FROM batch - WHERE "public"."users".id = batch.id; + WHERE "users".id = batch.id; GET DIAGNOSTICS rows_updated = ROW_COUNT; total_updated := total_updated + rows_updated; diff --git a/packages/prisma/migrations/20251024025759_add_webhook_version/migration.sql b/packages/prisma/migrations/20251024025759_add_webhook_version/migration.sql index 93180334da1f90..6b8e829ab9cd31 100644 --- a/packages/prisma/migrations/20251024025759_add_webhook_version/migration.sql +++ b/packages/prisma/migrations/20251024025759_add_webhook_version/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."Webhook" ADD COLUMN "version" TEXT NOT NULL DEFAULT '2021-10-20'; +ALTER TABLE "Webhook" ADD COLUMN "version" TEXT NOT NULL DEFAULT '2021-10-20'; diff --git a/packages/prisma/migrations/20251027102656_add_video_call_guest/migration.sql b/packages/prisma/migrations/20251027102656_add_video_call_guest/migration.sql index b3e3708ff20a51..2658ec20ecb6f5 100644 --- a/packages/prisma/migrations/20251027102656_add_video_call_guest/migration.sql +++ b/packages/prisma/migrations/20251027102656_add_video_call_guest/migration.sql @@ -1,8 +1,8 @@ -- AlterTable -ALTER TABLE "public"."CalVideoSettings" ADD COLUMN "requireEmailForGuests" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "CalVideoSettings" ADD COLUMN "requireEmailForGuests" BOOLEAN NOT NULL DEFAULT false; -- CreateTable -CREATE TABLE "public"."VideoCallGuest" ( +CREATE TABLE "VideoCallGuest" ( "id" TEXT NOT NULL, "bookingUid" TEXT NOT NULL, "email" TEXT NOT NULL, @@ -15,10 +15,10 @@ CREATE TABLE "public"."VideoCallGuest" ( ); -- CreateIndex -CREATE INDEX "VideoCallGuest_bookingUid_idx" ON "public"."VideoCallGuest"("bookingUid"); +CREATE INDEX "VideoCallGuest_bookingUid_idx" ON "VideoCallGuest"("bookingUid"); -- CreateIndex -CREATE INDEX "VideoCallGuest_email_idx" ON "public"."VideoCallGuest"("email"); +CREATE INDEX "VideoCallGuest_email_idx" ON "VideoCallGuest"("email"); -- CreateIndex -CREATE UNIQUE INDEX "VideoCallGuest_bookingUid_email_key" ON "public"."VideoCallGuest"("bookingUid", "email"); +CREATE UNIQUE INDEX "VideoCallGuest_bookingUid_email_key" ON "VideoCallGuest"("bookingUid", "email"); diff --git a/packages/prisma/migrations/20251030081154_add_report_status/migration.sql b/packages/prisma/migrations/20251030081154_add_report_status/migration.sql index 95ff3ea8003b1f..6f0d8c39258393 100644 --- a/packages/prisma/migrations/20251030081154_add_report_status/migration.sql +++ b/packages/prisma/migrations/20251030081154_add_report_status/migration.sql @@ -1,5 +1,5 @@ -- CreateEnum -CREATE TYPE "public"."BookingReportStatus" AS ENUM ('PENDING', 'DISMISSED', 'BLOCKED'); +CREATE TYPE "BookingReportStatus" AS ENUM ('PENDING', 'DISMISSED', 'BLOCKED'); -- AlterTable -ALTER TABLE "public"."BookingReport" ADD COLUMN "status" "public"."BookingReportStatus" NOT NULL DEFAULT 'PENDING'; +ALTER TABLE "BookingReport" ADD COLUMN "status" "BookingReportStatus" NOT NULL DEFAULT 'PENDING'; diff --git a/packages/prisma/migrations/20251103175338_make_user_uuid_required/migration.sql b/packages/prisma/migrations/20251103175338_make_user_uuid_required/migration.sql index a0f783cbf602e3..5a5a970ff32c1f 100644 --- a/packages/prisma/migrations/20251103175338_make_user_uuid_required/migration.sql +++ b/packages/prisma/migrations/20251103175338_make_user_uuid_required/migration.sql @@ -5,4 +5,4 @@ */ -- AlterTable -ALTER TABLE "public"."users" ALTER COLUMN "uuid" SET NOT NULL; +ALTER TABLE "users" ALTER COLUMN "uuid" SET NOT NULL; diff --git a/packages/prisma/migrations/20251110081648_add_delegation_credential_error_webhook_trigger/migration.sql b/packages/prisma/migrations/20251110081648_add_delegation_credential_error_webhook_trigger/migration.sql index 5477249efd3fba..9318b4e736b314 100644 --- a/packages/prisma/migrations/20251110081648_add_delegation_credential_error_webhook_trigger/migration.sql +++ b/packages/prisma/migrations/20251110081648_add_delegation_credential_error_webhook_trigger/migration.sql @@ -1,2 +1,2 @@ -- AlterEnum -ALTER TYPE "public"."WebhookTriggerEvents" ADD VALUE 'DELEGATION_CREDENTIAL_ERROR'; +ALTER TYPE "WebhookTriggerEvents" ADD VALUE 'DELEGATION_CREDENTIAL_ERROR'; diff --git a/packages/prisma/migrations/20251110160435_add_outbound_event_type_id_to_agent/migration.sql b/packages/prisma/migrations/20251110160435_add_outbound_event_type_id_to_agent/migration.sql index 2a16aef040ccc6..bc4f1605a4fa87 100644 --- a/packages/prisma/migrations/20251110160435_add_outbound_event_type_id_to_agent/migration.sql +++ b/packages/prisma/migrations/20251110160435_add_outbound_event_type_id_to_agent/migration.sql @@ -1,5 +1,5 @@ -- AlterTable -ALTER TABLE "public"."Agent" ADD COLUMN "outboundEventTypeId" INTEGER; +ALTER TABLE "Agent" ADD COLUMN "outboundEventTypeId" INTEGER; -- CreateIndex -CREATE INDEX "Agent_outboundEventTypeId_idx" ON "public"."Agent"("outboundEventTypeId"); +CREATE INDEX "Agent_outboundEventTypeId_idx" ON "Agent"("outboundEventTypeId"); diff --git a/packages/prisma/migrations/20251112171210_add_org_auto_join_on_signup_to_organization_settings/migration.sql b/packages/prisma/migrations/20251112171210_add_org_auto_join_on_signup_to_organization_settings/migration.sql index 294eaef1519f4b..2b660f5de38923 100644 --- a/packages/prisma/migrations/20251112171210_add_org_auto_join_on_signup_to_organization_settings/migration.sql +++ b/packages/prisma/migrations/20251112171210_add_org_auto_join_on_signup_to_organization_settings/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."OrganizationSettings" ADD COLUMN "orgAutoJoinOnSignup" BOOLEAN NOT NULL DEFAULT true; +ALTER TABLE "OrganizationSettings" ADD COLUMN "orgAutoJoinOnSignup" BOOLEAN NOT NULL DEFAULT true; diff --git a/packages/prisma/migrations/20251115043236_add_audit_booking/migration.sql b/packages/prisma/migrations/20251115043236_add_audit_booking/migration.sql index 70633dd858c8bc..9f8c6d89c6ca91 100644 --- a/packages/prisma/migrations/20251115043236_add_audit_booking/migration.sql +++ b/packages/prisma/migrations/20251115043236_add_audit_booking/migration.sql @@ -1,16 +1,16 @@ -- CreateEnum -CREATE TYPE "public"."BookingAuditType" AS ENUM ('record_created', 'record_updated', 'record_deleted'); +CREATE TYPE "BookingAuditType" AS ENUM ('record_created', 'record_updated', 'record_deleted'); -- CreateEnum -CREATE TYPE "public"."BookingAuditAction" AS ENUM ('created', 'cancelled', 'accepted', 'rejected', 'pending', 'awaiting_host', 'rescheduled', 'attendee_added', 'attendee_removed', 'reassignment', 'location_changed', 'host_no_show_updated', 'attendee_no_show_updated', 'reschedule_requested'); +CREATE TYPE "BookingAuditAction" AS ENUM ('created', 'cancelled', 'accepted', 'rejected', 'pending', 'awaiting_host', 'rescheduled', 'attendee_added', 'attendee_removed', 'reassignment', 'location_changed', 'host_no_show_updated', 'attendee_no_show_updated', 'reschedule_requested'); -- CreateEnum -CREATE TYPE "public"."AuditActorType" AS ENUM ('user', 'guest', 'attendee', 'system'); +CREATE TYPE "AuditActorType" AS ENUM ('user', 'guest', 'attendee', 'system'); -- CreateTable -CREATE TABLE "public"."AuditActor" ( +CREATE TABLE "AuditActor" ( "id" TEXT NOT NULL, - "type" "public"."AuditActorType" NOT NULL, + "type" "AuditActorType" NOT NULL, "userUuid" UUID, "attendeeId" INTEGER, "email" TEXT, @@ -22,12 +22,12 @@ CREATE TABLE "public"."AuditActor" ( ); -- CreateTable -CREATE TABLE "public"."BookingAudit" ( +CREATE TABLE "BookingAudit" ( "id" UUID NOT NULL, "bookingUid" TEXT NOT NULL, "actorId" TEXT NOT NULL, - "type" "public"."BookingAuditType" NOT NULL, - "action" "public"."BookingAuditAction" NOT NULL, + "type" "BookingAuditType" NOT NULL, + "action" "BookingAuditAction" NOT NULL, "timestamp" TIMESTAMP(3) NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL, @@ -37,34 +37,34 @@ CREATE TABLE "public"."BookingAudit" ( ); -- CreateIndex -CREATE INDEX "AuditActor_email_idx" ON "public"."AuditActor"("email"); +CREATE INDEX "AuditActor_email_idx" ON "AuditActor"("email"); -- CreateIndex -CREATE INDEX "AuditActor_userUuid_idx" ON "public"."AuditActor"("userUuid"); +CREATE INDEX "AuditActor_userUuid_idx" ON "AuditActor"("userUuid"); -- CreateIndex -CREATE INDEX "AuditActor_attendeeId_idx" ON "public"."AuditActor"("attendeeId"); +CREATE INDEX "AuditActor_attendeeId_idx" ON "AuditActor"("attendeeId"); -- CreateIndex -CREATE UNIQUE INDEX "AuditActor_userUuid_key" ON "public"."AuditActor"("userUuid"); +CREATE UNIQUE INDEX "AuditActor_userUuid_key" ON "AuditActor"("userUuid"); -- CreateIndex -CREATE UNIQUE INDEX "AuditActor_attendeeId_key" ON "public"."AuditActor"("attendeeId"); +CREATE UNIQUE INDEX "AuditActor_attendeeId_key" ON "AuditActor"("attendeeId"); -- CreateIndex -CREATE UNIQUE INDEX "AuditActor_email_key" ON "public"."AuditActor"("email"); +CREATE UNIQUE INDEX "AuditActor_email_key" ON "AuditActor"("email"); -- CreateIndex -CREATE UNIQUE INDEX "AuditActor_phone_key" ON "public"."AuditActor"("phone"); +CREATE UNIQUE INDEX "AuditActor_phone_key" ON "AuditActor"("phone"); -- CreateIndex -CREATE INDEX "BookingAudit_actorId_idx" ON "public"."BookingAudit"("actorId"); +CREATE INDEX "BookingAudit_actorId_idx" ON "BookingAudit"("actorId"); -- CreateIndex -CREATE INDEX "BookingAudit_bookingUid_idx" ON "public"."BookingAudit"("bookingUid"); +CREATE INDEX "BookingAudit_bookingUid_idx" ON "BookingAudit"("bookingUid"); -- CreateIndex -CREATE INDEX "BookingAudit_timestamp_idx" ON "public"."BookingAudit"("timestamp"); +CREATE INDEX "BookingAudit_timestamp_idx" ON "BookingAudit"("timestamp"); -- AddForeignKey -ALTER TABLE "public"."BookingAudit" ADD CONSTRAINT "BookingAudit_actorId_fkey" FOREIGN KEY ("actorId") REFERENCES "public"."AuditActor"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "BookingAudit" ADD CONSTRAINT "BookingAudit_actorId_fkey" FOREIGN KEY ("actorId") REFERENCES "AuditActor"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20251118120422_add_attendee_email_setting/migration.sql b/packages/prisma/migrations/20251118120422_add_attendee_email_setting/migration.sql index b0d7c98fe9f3ea..6c026928839f2b 100644 --- a/packages/prisma/migrations/20251118120422_add_attendee_email_setting/migration.sql +++ b/packages/prisma/migrations/20251118120422_add_attendee_email_setting/migration.sql @@ -1,5 +1,5 @@ -- AlterTable -ALTER TABLE "public"."OrganizationSettings" ADD COLUMN "disableAttendeeAwaitingPaymentEmail" BOOLEAN NOT NULL DEFAULT false, +ALTER TABLE "OrganizationSettings" ADD COLUMN "disableAttendeeAwaitingPaymentEmail" BOOLEAN NOT NULL DEFAULT false, ADD COLUMN "disableAttendeeCancellationEmail" BOOLEAN NOT NULL DEFAULT false, ADD COLUMN "disableAttendeeConfirmationEmail" BOOLEAN NOT NULL DEFAULT false, ADD COLUMN "disableAttendeeLocationChangeEmail" BOOLEAN NOT NULL DEFAULT false, diff --git a/packages/prisma/migrations/20251119124132_add_uuidv7_to_audit_actor/migration.sql b/packages/prisma/migrations/20251119124132_add_uuidv7_to_audit_actor/migration.sql index 7ed7084b8b5005..ee9e55dc44fd7f 100644 --- a/packages/prisma/migrations/20251119124132_add_uuidv7_to_audit_actor/migration.sql +++ b/packages/prisma/migrations/20251119124132_add_uuidv7_to_audit_actor/migration.sql @@ -7,14 +7,14 @@ */ -ALTER TABLE "public"."BookingAudit" DROP CONSTRAINT "BookingAudit_actorId_fkey"; +ALTER TABLE "BookingAudit" DROP CONSTRAINT "BookingAudit_actorId_fkey"; -ALTER TABLE "public"."BookingAudit" ALTER COLUMN "actorId" TYPE UUID USING "actorId"::UUID; +ALTER TABLE "BookingAudit" ALTER COLUMN "actorId" TYPE UUID USING "actorId"::UUID; -ALTER TABLE "public"."AuditActor" DROP CONSTRAINT "AuditActor_pkey"; +ALTER TABLE "AuditActor" DROP CONSTRAINT "AuditActor_pkey"; -ALTER TABLE "public"."AuditActor" ALTER COLUMN "id" TYPE UUID USING "id"::UUID; +ALTER TABLE "AuditActor" ALTER COLUMN "id" TYPE UUID USING "id"::UUID; -ALTER TABLE "public"."AuditActor" ADD CONSTRAINT "AuditActor_pkey" PRIMARY KEY ("id"); +ALTER TABLE "AuditActor" ADD CONSTRAINT "AuditActor_pkey" PRIMARY KEY ("id"); -ALTER TABLE "public"."BookingAudit" ADD CONSTRAINT "BookingAudit_actorId_fkey" FOREIGN KEY ("actorId") REFERENCES "public"."AuditActor"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "BookingAudit" ADD CONSTRAINT "BookingAudit_actorId_fkey" FOREIGN KEY ("actorId") REFERENCES "AuditActor"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20251121114503_add_pkce_oauth_client_type/migration.sql b/packages/prisma/migrations/20251121114503_add_pkce_oauth_client_type/migration.sql index 5d5835e827822c..9bc363f95abf0c 100644 --- a/packages/prisma/migrations/20251121114503_add_pkce_oauth_client_type/migration.sql +++ b/packages/prisma/migrations/20251121114503_add_pkce_oauth_client_type/migration.sql @@ -1,10 +1,10 @@ -- CreateEnum -CREATE TYPE "public"."OAuthClientType" AS ENUM ('confidential', 'public'); +CREATE TYPE "OAuthClientType" AS ENUM ('confidential', 'public'); -- AlterTable -ALTER TABLE "public"."AccessCode" ADD COLUMN "codeChallenge" TEXT, +ALTER TABLE "AccessCode" ADD COLUMN "codeChallenge" TEXT, ADD COLUMN "codeChallengeMethod" TEXT DEFAULT 'S256'; -- AlterTable -ALTER TABLE "public"."OAuthClient" ADD COLUMN "clientType" "public"."OAuthClientType" NOT NULL DEFAULT 'confidential', +ALTER TABLE "OAuthClient" ADD COLUMN "clientType" "OAuthClientType" NOT NULL DEFAULT 'confidential', ALTER COLUMN "clientSecret" DROP NOT NULL; diff --git a/packages/prisma/migrations/20251127102536_add_from_reschdule_index_to_booking/migration.sql b/packages/prisma/migrations/20251127102536_add_from_reschdule_index_to_booking/migration.sql index 9f7154b793e371..388d7e5f433cb9 100644 --- a/packages/prisma/migrations/20251127102536_add_from_reschdule_index_to_booking/migration.sql +++ b/packages/prisma/migrations/20251127102536_add_from_reschdule_index_to_booking/migration.sql @@ -1,2 +1,2 @@ -- CreateIndex -CREATE INDEX "Booking_fromReschedule_idx" ON "public"."Booking"("fromReschedule"); +CREATE INDEX "Booking_fromReschedule_idx" ON "Booking"("fromReschedule"); diff --git a/packages/prisma/migrations/20251129125459_add_show_note_publicly_to_ooo/migration.sql b/packages/prisma/migrations/20251129125459_add_show_note_publicly_to_ooo/migration.sql index ace6302087e487..3b1ec9061cb346 100644 --- a/packages/prisma/migrations/20251129125459_add_show_note_publicly_to_ooo/migration.sql +++ b/packages/prisma/migrations/20251129125459_add_show_note_publicly_to_ooo/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."OutOfOfficeEntry" ADD COLUMN "showNotePublicly" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "OutOfOfficeEntry" ADD COLUMN "showNotePublicly" BOOLEAN NOT NULL DEFAULT false; diff --git a/packages/prisma/migrations/20251202143411_add_auto_translate_title_enabled/migration.sql b/packages/prisma/migrations/20251202143411_add_auto_translate_title_enabled/migration.sql index 273175dbde6cb8..d648879a46e0ea 100644 --- a/packages/prisma/migrations/20251202143411_add_auto_translate_title_enabled/migration.sql +++ b/packages/prisma/migrations/20251202143411_add_auto_translate_title_enabled/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."EventType" ADD COLUMN "autoTranslateInstantMeetingTitleEnabled" BOOLEAN NOT NULL DEFAULT true; +ALTER TABLE "EventType" ADD COLUMN "autoTranslateInstantMeetingTitleEnabled" BOOLEAN NOT NULL DEFAULT true; diff --git a/packages/prisma/migrations/20251202181340_add_user_holiday_settings/migration.sql b/packages/prisma/migrations/20251202181340_add_user_holiday_settings/migration.sql index 320cd03d1331d4..62f11e2fcc4dba 100644 --- a/packages/prisma/migrations/20251202181340_add_user_holiday_settings/migration.sql +++ b/packages/prisma/migrations/20251202181340_add_user_holiday_settings/migration.sql @@ -1,5 +1,5 @@ -- CreateTable -CREATE TABLE "public"."UserHolidaySettings" ( +CREATE TABLE "UserHolidaySettings" ( "id" SERIAL NOT NULL, "userId" INTEGER NOT NULL, "countryCode" TEXT, @@ -11,7 +11,7 @@ CREATE TABLE "public"."UserHolidaySettings" ( ); -- CreateIndex -CREATE UNIQUE INDEX "UserHolidaySettings_userId_key" ON "public"."UserHolidaySettings"("userId"); +CREATE UNIQUE INDEX "UserHolidaySettings_userId_key" ON "UserHolidaySettings"("userId"); -- AddForeignKey -ALTER TABLE "public"."UserHolidaySettings" ADD CONSTRAINT "UserHolidaySettings_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "UserHolidaySettings" ADD CONSTRAINT "UserHolidaySettings_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20251203102204_add_min_reschedule_period/migration.sql b/packages/prisma/migrations/20251203102204_add_min_reschedule_period/migration.sql index e27514e06e1843..beb3d8fbfcfab0 100644 --- a/packages/prisma/migrations/20251203102204_add_min_reschedule_period/migration.sql +++ b/packages/prisma/migrations/20251203102204_add_min_reschedule_period/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."EventType" ADD COLUMN "minimumRescheduleNotice" INTEGER; +ALTER TABLE "EventType" ADD COLUMN "minimumRescheduleNotice" INTEGER; diff --git a/packages/prisma/migrations/20251205111359_add_is_trust_to_o_auth_client/migration.sql b/packages/prisma/migrations/20251205111359_add_is_trust_to_o_auth_client/migration.sql index 29d712b54b7b3d..48f6eae65adbea 100644 --- a/packages/prisma/migrations/20251205111359_add_is_trust_to_o_auth_client/migration.sql +++ b/packages/prisma/migrations/20251205111359_add_is_trust_to_o_auth_client/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."OAuthClient" ADD COLUMN "isTrusted" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "OAuthClient" ADD COLUMN "isTrusted" BOOLEAN NOT NULL DEFAULT false; diff --git a/packages/prisma/migrations/20251205150624_enable_host_subset/migration.sql b/packages/prisma/migrations/20251205150624_enable_host_subset/migration.sql index 1878c83c58c7e5..a71b901f26b7c8 100644 --- a/packages/prisma/migrations/20251205150624_enable_host_subset/migration.sql +++ b/packages/prisma/migrations/20251205150624_enable_host_subset/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."EventType" ADD COLUMN "rrHostSubsetEnabled" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "EventType" ADD COLUMN "rrHostSubsetEnabled" BOOLEAN NOT NULL DEFAULT false; diff --git a/packages/prisma/migrations/20251208035931_watchlist_audit_on_delete_set_null/migration.sql b/packages/prisma/migrations/20251208035931_watchlist_audit_on_delete_set_null/migration.sql index b034213318f69d..6b87650928e54f 100644 --- a/packages/prisma/migrations/20251208035931_watchlist_audit_on_delete_set_null/migration.sql +++ b/packages/prisma/migrations/20251208035931_watchlist_audit_on_delete_set_null/migration.sql @@ -1,8 +1,8 @@ -- DropForeignKey -ALTER TABLE "public"."WatchlistAudit" DROP CONSTRAINT "WatchlistAudit_watchlistId_fkey"; +ALTER TABLE "WatchlistAudit" DROP CONSTRAINT "WatchlistAudit_watchlistId_fkey"; -- AlterTable -ALTER TABLE "public"."WatchlistAudit" ALTER COLUMN "watchlistId" DROP NOT NULL; +ALTER TABLE "WatchlistAudit" ALTER COLUMN "watchlistId" DROP NOT NULL; -- AddForeignKey -ALTER TABLE "public"."WatchlistAudit" ADD CONSTRAINT "WatchlistAudit_watchlistId_fkey" FOREIGN KEY ("watchlistId") REFERENCES "public"."Watchlist"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "WatchlistAudit" ADD CONSTRAINT "WatchlistAudit_watchlistId_fkey" FOREIGN KEY ("watchlistId") REFERENCES "Watchlist"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20251210143104_add_enabled_to_user_and_team_features/migration.sql b/packages/prisma/migrations/20251210143104_add_enabled_to_user_and_team_features/migration.sql index bde838d3d07c61..3b4179f86aef60 100644 --- a/packages/prisma/migrations/20251210143104_add_enabled_to_user_and_team_features/migration.sql +++ b/packages/prisma/migrations/20251210143104_add_enabled_to_user_and_team_features/migration.sql @@ -1,9 +1,9 @@ -- AlterTable: Add enabled column with DEFAULT true so existing rows get enabled=true -ALTER TABLE "public"."TeamFeatures" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true; +ALTER TABLE "TeamFeatures" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true; -- AlterTable: Add enabled column with DEFAULT true so existing rows get enabled=true -ALTER TABLE "public"."UserFeatures" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true; +ALTER TABLE "UserFeatures" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true; -- Remove the DEFAULT constraint so new rows must explicitly set enabled -ALTER TABLE "public"."TeamFeatures" ALTER COLUMN "enabled" DROP DEFAULT; -ALTER TABLE "public"."UserFeatures" ALTER COLUMN "enabled" DROP DEFAULT; +ALTER TABLE "TeamFeatures" ALTER COLUMN "enabled" DROP DEFAULT; +ALTER TABLE "UserFeatures" ALTER COLUMN "enabled" DROP DEFAULT; diff --git a/packages/prisma/migrations/20251216074521_enhance_booking_audit_schema/migration.sql b/packages/prisma/migrations/20251216074521_enhance_booking_audit_schema/migration.sql index 8c23c4ed58b236..0bfa7cf546dbe9 100644 --- a/packages/prisma/migrations/20251216074521_enhance_booking_audit_schema/migration.sql +++ b/packages/prisma/migrations/20251216074521_enhance_booking_audit_schema/migration.sql @@ -6,10 +6,10 @@ */ -- CreateEnum -CREATE TYPE "public"."BookingAuditSource" AS ENUM ('api_v1', 'api_v2', 'webapp', 'webhook', 'unknown'); +CREATE TYPE "BookingAuditSource" AS ENUM ('api_v1', 'api_v2', 'webapp', 'webhook', 'unknown'); -- AlterEnum -ALTER TYPE "public"."AuditActorType" ADD VALUE 'app'; +ALTER TYPE "AuditActorType" ADD VALUE 'app'; -- AlterEnum -- This migration adds more than one value to an enum. @@ -19,12 +19,12 @@ ALTER TYPE "public"."AuditActorType" ADD VALUE 'app'; -- the enum. -ALTER TYPE "public"."BookingAuditAction" ADD VALUE 'seat_booked'; -ALTER TYPE "public"."BookingAuditAction" ADD VALUE 'seat_rescheduled'; +ALTER TYPE "BookingAuditAction" ADD VALUE 'seat_booked'; +ALTER TYPE "BookingAuditAction" ADD VALUE 'seat_rescheduled'; -- AlterTable -ALTER TABLE "public"."BookingAudit" ADD COLUMN "operationId" TEXT NOT NULL, -ADD COLUMN "source" "public"."BookingAuditSource" NOT NULL; +ALTER TABLE "BookingAudit" ADD COLUMN "operationId" TEXT NOT NULL, +ADD COLUMN "source" "BookingAuditSource" NOT NULL; -- CreateIndex -CREATE INDEX "BookingAudit_operationId_idx" ON "public"."BookingAudit"("operationId"); +CREATE INDEX "BookingAudit_operationId_idx" ON "BookingAudit"("operationId"); diff --git a/packages/prisma/migrations/20251217090304_enhance_audit_schema/migration.sql b/packages/prisma/migrations/20251217090304_enhance_audit_schema/migration.sql index 8aa9ff879dd92e..05c51abc1b10ca 100644 --- a/packages/prisma/migrations/20251217090304_enhance_audit_schema/migration.sql +++ b/packages/prisma/migrations/20251217090304_enhance_audit_schema/migration.sql @@ -5,10 +5,10 @@ */ -- AlterTable -ALTER TABLE "public"."AuditActor" ADD COLUMN "credentialId" INTEGER; +ALTER TABLE "AuditActor" ADD COLUMN "credentialId" INTEGER; -- CreateIndex -CREATE INDEX "AuditActor_credentialId_idx" ON "public"."AuditActor"("credentialId"); +CREATE INDEX "AuditActor_credentialId_idx" ON "AuditActor"("credentialId"); -- CreateIndex -CREATE UNIQUE INDEX "AuditActor_credentialId_key" ON "public"."AuditActor"("credentialId"); +CREATE UNIQUE INDEX "AuditActor_credentialId_key" ON "AuditActor"("credentialId"); diff --git a/packages/prisma/migrations/20251217155117_add_auto_opt_in_features/migration.sql b/packages/prisma/migrations/20251217155117_add_auto_opt_in_features/migration.sql index 12fe20966eafd9..cb02fc0b87ff04 100644 --- a/packages/prisma/migrations/20251217155117_add_auto_opt_in_features/migration.sql +++ b/packages/prisma/migrations/20251217155117_add_auto_opt_in_features/migration.sql @@ -1,5 +1,5 @@ -- AlterTable -ALTER TABLE "public"."Team" ADD COLUMN "autoOptInFeatures" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "Team" ADD COLUMN "autoOptInFeatures" BOOLEAN NOT NULL DEFAULT false; -- AlterTable -ALTER TABLE "public"."users" ADD COLUMN "autoOptInFeatures" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "users" ADD COLUMN "autoOptInFeatures" BOOLEAN NOT NULL DEFAULT false; diff --git a/packages/prisma/migrations/20251218173119_add_global_watchlist/migration.sql b/packages/prisma/migrations/20251218173119_add_global_watchlist/migration.sql index 5f8efdbcf398df..6fb69162586838 100644 --- a/packages/prisma/migrations/20251218173119_add_global_watchlist/migration.sql +++ b/packages/prisma/migrations/20251218173119_add_global_watchlist/migration.sql @@ -1,15 +1,15 @@ -- CreateEnum -CREATE TYPE "public"."SystemReportStatus" AS ENUM ('PENDING', 'BLOCKED', 'DISMISSED'); +CREATE TYPE "SystemReportStatus" AS ENUM ('PENDING', 'BLOCKED', 'DISMISSED'); -- AlterTable -ALTER TABLE "public"."BookingReport" ADD COLUMN "globalWatchlistId" UUID, -ADD COLUMN "systemStatus" "public"."SystemReportStatus" NOT NULL DEFAULT 'PENDING'; +ALTER TABLE "BookingReport" ADD COLUMN "globalWatchlistId" UUID, +ADD COLUMN "systemStatus" "SystemReportStatus" NOT NULL DEFAULT 'PENDING'; -- CreateIndex -CREATE INDEX "BookingReport_globalWatchlistId_idx" ON "public"."BookingReport"("globalWatchlistId"); +CREATE INDEX "BookingReport_globalWatchlistId_idx" ON "BookingReport"("globalWatchlistId"); -- CreateIndex -CREATE INDEX "BookingReport_systemStatus_idx" ON "public"."BookingReport"("systemStatus"); +CREATE INDEX "BookingReport_systemStatus_idx" ON "BookingReport"("systemStatus"); -- AddForeignKey -ALTER TABLE "public"."BookingReport" ADD CONSTRAINT "BookingReport_globalWatchlistId_fkey" FOREIGN KEY ("globalWatchlistId") REFERENCES "public"."Watchlist"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "BookingReport" ADD CONSTRAINT "BookingReport_globalWatchlistId_fkey" FOREIGN KEY ("globalWatchlistId") REFERENCES "Watchlist"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20251220034814_add_custom_calendar_reminder/migration.sql b/packages/prisma/migrations/20251220034814_add_custom_calendar_reminder/migration.sql index 0d1b7624652129..ad6a40e5930bae 100644 --- a/packages/prisma/migrations/20251220034814_add_custom_calendar_reminder/migration.sql +++ b/packages/prisma/migrations/20251220034814_add_custom_calendar_reminder/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."DestinationCalendar" ADD COLUMN "customCalendarReminder" INTEGER; +ALTER TABLE "DestinationCalendar" ADD COLUMN "customCalendarReminder" INTEGER; diff --git a/packages/prisma/migrations/20251224092336_add_context_audit_action/migration.sql b/packages/prisma/migrations/20251224092336_add_context_audit_action/migration.sql index 4693eae322bad9..6f462b21bf0ecf 100644 --- a/packages/prisma/migrations/20251224092336_add_context_audit_action/migration.sql +++ b/packages/prisma/migrations/20251224092336_add_context_audit_action/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."BookingAudit" ADD COLUMN "context" JSONB; +ALTER TABLE "BookingAudit" ADD COLUMN "context" JSONB; diff --git a/packages/prisma/migrations/20260105071846_update_watchlist_index_with_is_global/migration.sql b/packages/prisma/migrations/20260105071846_update_watchlist_index_with_is_global/migration.sql index 401fc9a633c9ff..d4f4ecbca335e2 100644 --- a/packages/prisma/migrations/20260105071846_update_watchlist_index_with_is_global/migration.sql +++ b/packages/prisma/migrations/20260105071846_update_watchlist_index_with_is_global/migration.sql @@ -1,5 +1,5 @@ -- DropIndex -DROP INDEX "public"."Watchlist_type_value_organizationId_action_idx"; +DROP INDEX "Watchlist_type_value_organizationId_action_idx"; -- CreateIndex -CREATE INDEX "Watchlist_isGlobal_action_organizationId_type_value_idx" ON "public"."Watchlist"("isGlobal", "action", "organizationId", "type", "value"); +CREATE INDEX "Watchlist_isGlobal_action_organizationId_type_value_idx" ON "Watchlist"("isGlobal", "action", "organizationId", "type", "value"); diff --git a/packages/prisma/migrations/20260106093811_add_monthly_proration_tracking/migration.sql b/packages/prisma/migrations/20260106093811_add_monthly_proration_tracking/migration.sql index 76705f1d6d4e6d..3171cf97a7c957 100644 --- a/packages/prisma/migrations/20260106093811_add_monthly_proration_tracking/migration.sql +++ b/packages/prisma/migrations/20260106093811_add_monthly_proration_tracking/migration.sql @@ -1,24 +1,24 @@ -- CreateEnum -CREATE TYPE "public"."SeatChangeType" AS ENUM ('ADDITION', 'REMOVAL'); +CREATE TYPE "SeatChangeType" AS ENUM ('ADDITION', 'REMOVAL'); -- CreateEnum -CREATE TYPE "public"."ProrationStatus" AS ENUM ('PENDING', 'INVOICE_CREATED', 'CHARGED', 'FAILED', 'CANCELLED'); +CREATE TYPE "ProrationStatus" AS ENUM ('PENDING', 'INVOICE_CREATED', 'CHARGED', 'FAILED', 'CANCELLED'); -- AlterTable -ALTER TABLE "public"."OrganizationBilling" ADD COLUMN "billingPeriod" "public"."BillingPeriod", +ALTER TABLE "OrganizationBilling" ADD COLUMN "billingPeriod" "BillingPeriod", ADD COLUMN "pricePerSeat" INTEGER, ADD COLUMN "paidSeats" INTEGER; -- AlterTable -ALTER TABLE "public"."TeamBilling" ADD COLUMN "billingPeriod" "public"."BillingPeriod", +ALTER TABLE "TeamBilling" ADD COLUMN "billingPeriod" "BillingPeriod", ADD COLUMN "pricePerSeat" INTEGER, ADD COLUMN "paidSeats" INTEGER; -- CreateTable -CREATE TABLE "public"."SeatChangeLog" ( +CREATE TABLE "SeatChangeLog" ( "id" TEXT NOT NULL, "teamId" INTEGER NOT NULL, - "changeType" "public"."SeatChangeType" NOT NULL, + "changeType" "SeatChangeType" NOT NULL, "seatCount" INTEGER NOT NULL, "userId" INTEGER, "triggeredBy" INTEGER, @@ -34,7 +34,7 @@ CREATE TABLE "public"."SeatChangeLog" ( ); -- CreateTable -CREATE TABLE "public"."MonthlyProration" ( +CREATE TABLE "MonthlyProration" ( "id" TEXT NOT NULL, "teamId" INTEGER NOT NULL, "monthKey" TEXT NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE "public"."MonthlyProration" ( "proratedAmount" INTEGER NOT NULL, "invoiceItemId" TEXT, "invoiceId" TEXT, - "status" "public"."ProrationStatus" NOT NULL DEFAULT 'PENDING', + "status" "ProrationStatus" NOT NULL DEFAULT 'PENDING', "chargedAt" TIMESTAMP(3), "failedAt" TIMESTAMP(3), "failureReason" TEXT, @@ -70,48 +70,48 @@ CREATE TABLE "public"."MonthlyProration" ( ); -- CreateIndex -CREATE INDEX "SeatChangeLog_teamId_monthKey_idx" ON "public"."SeatChangeLog"("teamId", "monthKey"); +CREATE INDEX "SeatChangeLog_teamId_monthKey_idx" ON "SeatChangeLog"("teamId", "monthKey"); -- CreateIndex -CREATE INDEX "SeatChangeLog_teamId_processedInProrationId_idx" ON "public"."SeatChangeLog"("teamId", "processedInProrationId"); +CREATE INDEX "SeatChangeLog_teamId_processedInProrationId_idx" ON "SeatChangeLog"("teamId", "processedInProrationId"); -- CreateIndex -CREATE INDEX "SeatChangeLog_monthKey_idx" ON "public"."SeatChangeLog"("monthKey"); +CREATE INDEX "SeatChangeLog_monthKey_idx" ON "SeatChangeLog"("monthKey"); -- CreateIndex -CREATE INDEX "MonthlyProration_monthKey_status_idx" ON "public"."MonthlyProration"("monthKey", "status"); +CREATE INDEX "MonthlyProration_monthKey_status_idx" ON "MonthlyProration"("monthKey", "status"); -- CreateIndex -CREATE INDEX "MonthlyProration_status_idx" ON "public"."MonthlyProration"("status"); +CREATE INDEX "MonthlyProration_status_idx" ON "MonthlyProration"("status"); -- CreateIndex -CREATE INDEX "MonthlyProration_teamId_idx" ON "public"."MonthlyProration"("teamId"); +CREATE INDEX "MonthlyProration_teamId_idx" ON "MonthlyProration"("teamId"); -- CreateIndex -CREATE UNIQUE INDEX "MonthlyProration_teamId_monthKey_key" ON "public"."MonthlyProration"("teamId", "monthKey"); +CREATE UNIQUE INDEX "MonthlyProration_teamId_monthKey_key" ON "MonthlyProration"("teamId", "monthKey"); -- AddForeignKey -ALTER TABLE "public"."SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "public"."Team"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_processedInProrationId_fkey" FOREIGN KEY ("processedInProrationId") REFERENCES "public"."MonthlyProration"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_processedInProrationId_fkey" FOREIGN KEY ("processedInProrationId") REFERENCES "MonthlyProration"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_teamBillingId_fkey" FOREIGN KEY ("teamBillingId") REFERENCES "public"."TeamBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_teamBillingId_fkey" FOREIGN KEY ("teamBillingId") REFERENCES "TeamBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_organizationBillingId_fkey" FOREIGN KEY ("organizationBillingId") REFERENCES "public"."OrganizationBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "SeatChangeLog" ADD CONSTRAINT "SeatChangeLog_organizationBillingId_fkey" FOREIGN KEY ("organizationBillingId") REFERENCES "OrganizationBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."MonthlyProration" ADD CONSTRAINT "MonthlyProration_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "public"."Team"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "MonthlyProration" ADD CONSTRAINT "MonthlyProration_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."MonthlyProration" ADD CONSTRAINT "MonthlyProration_teamBillingId_fkey" FOREIGN KEY ("teamBillingId") REFERENCES "public"."TeamBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "MonthlyProration" ADD CONSTRAINT "MonthlyProration_teamBillingId_fkey" FOREIGN KEY ("teamBillingId") REFERENCES "TeamBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."MonthlyProration" ADD CONSTRAINT "MonthlyProration_organizationBillingId_fkey" FOREIGN KEY ("organizationBillingId") REFERENCES "public"."OrganizationBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "MonthlyProration" ADD CONSTRAINT "MonthlyProration_organizationBillingId_fkey" FOREIGN KEY ("organizationBillingId") REFERENCES "OrganizationBilling"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- Insert feature flag (disabled by default) -INSERT INTO "public"."Feature" ("slug", "enabled", "description", "type", "stale", "lastUsedAt", "createdAt", "updatedAt") +INSERT INTO "Feature" ("slug", "enabled", "description", "type", "stale", "lastUsedAt", "createdAt", "updatedAt") VALUES ('monthly-proration', false, 'Monthly aggregated seat proration for annual plans', 'RELEASE', false, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) ON CONFLICT ("slug") DO NOTHING; diff --git a/packages/prisma/migrations/20260107093019_add_magic_link_source/migration.sql b/packages/prisma/migrations/20260107093019_add_magic_link_source/migration.sql index e32e218fd1ff09..2d685859d92c0c 100644 --- a/packages/prisma/migrations/20260107093019_add_magic_link_source/migration.sql +++ b/packages/prisma/migrations/20260107093019_add_magic_link_source/migration.sql @@ -1,2 +1,2 @@ -- AlterEnum -ALTER TYPE "public"."BookingAuditSource" ADD VALUE 'magic_link'; +ALTER TYPE "BookingAuditSource" ADD VALUE 'magic_link'; diff --git a/packages/prisma/migrations/20260112172746_add_integration_attribute_sync/migration.sql b/packages/prisma/migrations/20260112172746_add_integration_attribute_sync/migration.sql index e6b6af940532fd..9b8a0085de005d 100644 --- a/packages/prisma/migrations/20260112172746_add_integration_attribute_sync/migration.sql +++ b/packages/prisma/migrations/20260112172746_add_integration_attribute_sync/migration.sql @@ -1,5 +1,5 @@ -- CreateTable -CREATE TABLE "public"."IntegrationAttributeSync" ( +CREATE TABLE "IntegrationAttributeSync" ( "id" TEXT NOT NULL, "organizationId" INTEGER NOT NULL, "name" TEXT NOT NULL, @@ -13,7 +13,7 @@ CREATE TABLE "public"."IntegrationAttributeSync" ( ); -- CreateTable -CREATE TABLE "public"."AttributeSyncRule" ( +CREATE TABLE "AttributeSyncRule" ( "id" TEXT NOT NULL, "integrationAttributeSyncId" TEXT NOT NULL, "rule" JSONB NOT NULL, @@ -24,7 +24,7 @@ CREATE TABLE "public"."AttributeSyncRule" ( ); -- CreateTable -CREATE TABLE "public"."AttributeSyncFieldMapping" ( +CREATE TABLE "AttributeSyncFieldMapping" ( "id" TEXT NOT NULL, "integrationFieldName" TEXT NOT NULL, "attributeId" TEXT NOT NULL, @@ -37,25 +37,25 @@ CREATE TABLE "public"."AttributeSyncFieldMapping" ( ); -- CreateIndex -CREATE INDEX "IntegrationAttributeSync_organizationId_idx" ON "public"."IntegrationAttributeSync"("organizationId"); +CREATE INDEX "IntegrationAttributeSync_organizationId_idx" ON "IntegrationAttributeSync"("organizationId"); -- CreateIndex -CREATE UNIQUE INDEX "AttributeSyncRule_integrationAttributeSyncId_key" ON "public"."AttributeSyncRule"("integrationAttributeSyncId"); +CREATE UNIQUE INDEX "AttributeSyncRule_integrationAttributeSyncId_key" ON "AttributeSyncRule"("integrationAttributeSyncId"); -- CreateIndex -CREATE INDEX "AttributeSyncFieldMapping_integrationAttributeSyncId_idx" ON "public"."AttributeSyncFieldMapping"("integrationAttributeSyncId"); +CREATE INDEX "AttributeSyncFieldMapping_integrationAttributeSyncId_idx" ON "AttributeSyncFieldMapping"("integrationAttributeSyncId"); -- AddForeignKey -ALTER TABLE "public"."IntegrationAttributeSync" ADD CONSTRAINT "IntegrationAttributeSync_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "public"."Team"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "IntegrationAttributeSync" ADD CONSTRAINT "IntegrationAttributeSync_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."IntegrationAttributeSync" ADD CONSTRAINT "IntegrationAttributeSync_credentialId_fkey" FOREIGN KEY ("credentialId") REFERENCES "public"."Credential"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "IntegrationAttributeSync" ADD CONSTRAINT "IntegrationAttributeSync_credentialId_fkey" FOREIGN KEY ("credentialId") REFERENCES "Credential"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."AttributeSyncRule" ADD CONSTRAINT "AttributeSyncRule_integrationAttributeSyncId_fkey" FOREIGN KEY ("integrationAttributeSyncId") REFERENCES "public"."IntegrationAttributeSync"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "AttributeSyncRule" ADD CONSTRAINT "AttributeSyncRule_integrationAttributeSyncId_fkey" FOREIGN KEY ("integrationAttributeSyncId") REFERENCES "IntegrationAttributeSync"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."AttributeSyncFieldMapping" ADD CONSTRAINT "AttributeSyncFieldMapping_attributeId_fkey" FOREIGN KEY ("attributeId") REFERENCES "public"."Attribute"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "AttributeSyncFieldMapping" ADD CONSTRAINT "AttributeSyncFieldMapping_attributeId_fkey" FOREIGN KEY ("attributeId") REFERENCES "Attribute"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."AttributeSyncFieldMapping" ADD CONSTRAINT "AttributeSyncFieldMapping_integrationAttributeSyncId_fkey" FOREIGN KEY ("integrationAttributeSyncId") REFERENCES "public"."IntegrationAttributeSync"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "AttributeSyncFieldMapping" ADD CONSTRAINT "AttributeSyncFieldMapping_integrationAttributeSyncId_fkey" FOREIGN KEY ("integrationAttributeSyncId") REFERENCES "IntegrationAttributeSync"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20260113140724_add_missing_integrationattributesync_and_credential_index/migration.sql b/packages/prisma/migrations/20260113140724_add_missing_integrationattributesync_and_credential_index/migration.sql index 9224599223949a..f11ae149714420 100644 --- a/packages/prisma/migrations/20260113140724_add_missing_integrationattributesync_and_credential_index/migration.sql +++ b/packages/prisma/migrations/20260113140724_add_missing_integrationattributesync_and_credential_index/migration.sql @@ -1,2 +1,2 @@ -- CreateIndex -CREATE INDEX "IntegrationAttributeSync_credentialId_idx" ON "public"."IntegrationAttributeSync"("credentialId"); +CREATE INDEX "IntegrationAttributeSync_credentialId_idx" ON "IntegrationAttributeSync"("credentialId"); diff --git a/packages/prisma/migrations/20260114154054_add_oauth_client_properties/migration.sql b/packages/prisma/migrations/20260114154054_add_oauth_client_properties/migration.sql index 20d0dd409a17e3..0b295af0a91f61 100644 --- a/packages/prisma/migrations/20260114154054_add_oauth_client_properties/migration.sql +++ b/packages/prisma/migrations/20260114154054_add_oauth_client_properties/migration.sql @@ -1,16 +1,16 @@ -- CreateEnum -CREATE TYPE "public"."OAuthClientStatus" AS ENUM ('pending', 'approved', 'rejected'); +CREATE TYPE "OAuthClientStatus" AS ENUM ('pending', 'approved', 'rejected'); -- AlterTable -ALTER TABLE "public"."OAuthClient" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, +ALTER TABLE "OAuthClient" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, ADD COLUMN "purpose" TEXT, ADD COLUMN "rejectionReason" TEXT, -ADD COLUMN "status" "public"."OAuthClientStatus" NOT NULL DEFAULT 'approved', +ADD COLUMN "status" "OAuthClientStatus" NOT NULL DEFAULT 'approved', ADD COLUMN "userId" INTEGER, ADD COLUMN "websiteUrl" TEXT; -- CreateIndex -CREATE INDEX "OAuthClient_userId_idx" ON "public"."OAuthClient"("userId"); +CREATE INDEX "OAuthClient_userId_idx" ON "OAuthClient"("userId"); -- AddForeignKey -ALTER TABLE "public"."OAuthClient" ADD CONSTRAINT "OAuthClient_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "OAuthClient" ADD CONSTRAINT "OAuthClient_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20260115111819_add_cancellation_reason_require/migration.sql b/packages/prisma/migrations/20260115111819_add_cancellation_reason_require/migration.sql index 5caebc6a86c97b..a1bbb670f5488d 100644 --- a/packages/prisma/migrations/20260115111819_add_cancellation_reason_require/migration.sql +++ b/packages/prisma/migrations/20260115111819_add_cancellation_reason_require/migration.sql @@ -1,5 +1,5 @@ -- CreateEnum -CREATE TYPE "public"."CancellationReasonRequirement" AS ENUM ('MANDATORY_BOTH', 'MANDATORY_HOST_ONLY', 'MANDATORY_ATTENDEE_ONLY', 'OPTIONAL_BOTH'); +CREATE TYPE "CancellationReasonRequirement" AS ENUM ('MANDATORY_BOTH', 'MANDATORY_HOST_ONLY', 'MANDATORY_ATTENDEE_ONLY', 'OPTIONAL_BOTH'); -- AlterTable -ALTER TABLE "public"."EventType" ADD COLUMN "requiresCancellationReason" "public"."CancellationReasonRequirement" DEFAULT 'MANDATORY_HOST_ONLY'; +ALTER TABLE "EventType" ADD COLUMN "requiresCancellationReason" "CancellationReasonRequirement" DEFAULT 'MANDATORY_HOST_ONLY'; diff --git a/packages/prisma/migrations/20260115155453_add_integration_sync_constraint_on_mapping_and_attribute/migration.sql b/packages/prisma/migrations/20260115155453_add_integration_sync_constraint_on_mapping_and_attribute/migration.sql index 8dd118ec173c4e..9da843aae374d4 100644 --- a/packages/prisma/migrations/20260115155453_add_integration_sync_constraint_on_mapping_and_attribute/migration.sql +++ b/packages/prisma/migrations/20260115155453_add_integration_sync_constraint_on_mapping_and_attribute/migration.sql @@ -5,4 +5,4 @@ */ -- CreateIndex -CREATE UNIQUE INDEX IF NOT EXISTS "AttributeSyncFieldMapping_integrationAttributeSyncId_attrib_key" ON "public"."AttributeSyncFieldMapping"("integrationAttributeSyncId", "attributeId"); +CREATE UNIQUE INDEX IF NOT EXISTS "AttributeSyncFieldMapping_integrationAttributeSyncId_attrib_key" ON "AttributeSyncFieldMapping"("integrationAttributeSyncId", "attributeId"); diff --git a/packages/prisma/migrations/20260116145525_add_custom_host_location/migration.sql b/packages/prisma/migrations/20260116145525_add_custom_host_location/migration.sql index 55c5b4d79a6487..2bd462e4b1c3e8 100644 --- a/packages/prisma/migrations/20260116145525_add_custom_host_location/migration.sql +++ b/packages/prisma/migrations/20260116145525_add_custom_host_location/migration.sql @@ -1,8 +1,8 @@ -- AlterTable -ALTER TABLE "public"."EventType" ADD COLUMN "enablePerHostLocations" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "EventType" ADD COLUMN "enablePerHostLocations" BOOLEAN NOT NULL DEFAULT false; -- CreateTable -CREATE TABLE "public"."HostLocation" ( +CREATE TABLE "HostLocation" ( "id" TEXT NOT NULL, "userId" INTEGER NOT NULL, "eventTypeId" INTEGER NOT NULL, @@ -18,16 +18,16 @@ CREATE TABLE "public"."HostLocation" ( ); -- CreateIndex -CREATE INDEX "HostLocation_credentialId_idx" ON "public"."HostLocation"("credentialId"); +CREATE INDEX "HostLocation_credentialId_idx" ON "HostLocation"("credentialId"); -- CreateIndex -CREATE INDEX "HostLocation_eventTypeId_idx" ON "public"."HostLocation"("eventTypeId"); +CREATE INDEX "HostLocation_eventTypeId_idx" ON "HostLocation"("eventTypeId"); -- CreateIndex -CREATE UNIQUE INDEX "HostLocation_userId_eventTypeId_key" ON "public"."HostLocation"("userId", "eventTypeId"); +CREATE UNIQUE INDEX "HostLocation_userId_eventTypeId_key" ON "HostLocation"("userId", "eventTypeId"); -- AddForeignKey -ALTER TABLE "public"."HostLocation" ADD CONSTRAINT "HostLocation_userId_eventTypeId_fkey" FOREIGN KEY ("userId", "eventTypeId") REFERENCES "public"."Host"("userId", "eventTypeId") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "HostLocation" ADD CONSTRAINT "HostLocation_userId_eventTypeId_fkey" FOREIGN KEY ("userId", "eventTypeId") REFERENCES "Host"("userId", "eventTypeId") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."HostLocation" ADD CONSTRAINT "HostLocation_credentialId_fkey" FOREIGN KEY ("credentialId") REFERENCES "public"."Credential"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "HostLocation" ADD CONSTRAINT "HostLocation_credentialId_fkey" FOREIGN KEY ("credentialId") REFERENCES "Credential"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20260119113000_add_system_source/migration.sql b/packages/prisma/migrations/20260119113000_add_system_source/migration.sql index f36210d8fc376c..7760306c14673d 100644 --- a/packages/prisma/migrations/20260119113000_add_system_source/migration.sql +++ b/packages/prisma/migrations/20260119113000_add_system_source/migration.sql @@ -1,2 +1,2 @@ -- AlterEnum -ALTER TYPE "public"."BookingAuditSource" ADD VALUE 'system'; +ALTER TYPE "BookingAuditSource" ADD VALUE 'system'; diff --git a/packages/prisma/migrations/20260119120000_add_seat_change_log_operation_id/migration.sql b/packages/prisma/migrations/20260119120000_add_seat_change_log_operation_id/migration.sql index dd9b47076161ba..5a6065c58beed4 100644 --- a/packages/prisma/migrations/20260119120000_add_seat_change_log_operation_id/migration.sql +++ b/packages/prisma/migrations/20260119120000_add_seat_change_log_operation_id/migration.sql @@ -5,7 +5,7 @@ */ -- AlterTable -ALTER TABLE "public"."SeatChangeLog" ADD COLUMN "operationId" TEXT; +ALTER TABLE "SeatChangeLog" ADD COLUMN "operationId" TEXT; -- CreateIndex -CREATE UNIQUE INDEX "SeatChangeLog_teamId_operationId_key" ON "public"."SeatChangeLog"("teamId", "operationId"); +CREATE UNIQUE INDEX "SeatChangeLog_teamId_operationId_key" ON "SeatChangeLog"("teamId", "operationId"); diff --git a/packages/prisma/migrations/20260119184420_add_calendar_subscription_error/migration.sql b/packages/prisma/migrations/20260119184420_add_calendar_subscription_error/migration.sql index eb81b0616268e0..03ef509426d576 100644 --- a/packages/prisma/migrations/20260119184420_add_calendar_subscription_error/migration.sql +++ b/packages/prisma/migrations/20260119184420_add_calendar_subscription_error/migration.sql @@ -1,4 +1,4 @@ -- AlterTable -ALTER TABLE "public"."SelectedCalendar" +ALTER TABLE "SelectedCalendar" ADD COLUMN "syncSubscribedErrorAt" TIMESTAMP(3), ADD COLUMN "syncSubscribedErrorCount" INTEGER NOT NULL DEFAULT 0; diff --git a/packages/prisma/migrations/20260121145242_add_workflow_step_translation/migration.sql b/packages/prisma/migrations/20260121145242_add_workflow_step_translation/migration.sql index 8054d1d74e22d5..cc4b67206a937a 100644 --- a/packages/prisma/migrations/20260121145242_add_workflow_step_translation/migration.sql +++ b/packages/prisma/migrations/20260121145242_add_workflow_step_translation/migration.sql @@ -1,15 +1,15 @@ -- CreateEnum -CREATE TYPE "public"."WorkflowStepAutoTranslatedField" AS ENUM ('REMINDER_BODY', 'EMAIL_SUBJECT'); +CREATE TYPE "WorkflowStepAutoTranslatedField" AS ENUM ('REMINDER_BODY', 'EMAIL_SUBJECT'); -- AlterTable -ALTER TABLE "public"."WorkflowStep" ADD COLUMN "autoTranslateEnabled" BOOLEAN NOT NULL DEFAULT false, +ALTER TABLE "WorkflowStep" ADD COLUMN "autoTranslateEnabled" BOOLEAN NOT NULL DEFAULT false, ADD COLUMN "sourceLocale" TEXT; -- CreateTable -CREATE TABLE "public"."WorkflowStepTranslation" ( +CREATE TABLE "WorkflowStepTranslation" ( "uid" TEXT NOT NULL, "workflowStepId" INTEGER NOT NULL, - "field" "public"."WorkflowStepAutoTranslatedField" NOT NULL, + "field" "WorkflowStepAutoTranslatedField" NOT NULL, "sourceLocale" TEXT NOT NULL, "targetLocale" TEXT NOT NULL, "translatedText" TEXT NOT NULL, @@ -20,7 +20,7 @@ CREATE TABLE "public"."WorkflowStepTranslation" ( ); -- CreateIndex -CREATE UNIQUE INDEX "WorkflowStepTranslation_workflowStepId_field_targetLocale_key" ON "public"."WorkflowStepTranslation"("workflowStepId", "field", "targetLocale"); +CREATE UNIQUE INDEX "WorkflowStepTranslation_workflowStepId_field_targetLocale_key" ON "WorkflowStepTranslation"("workflowStepId", "field", "targetLocale"); -- AddForeignKey -ALTER TABLE "public"."WorkflowStepTranslation" ADD CONSTRAINT "WorkflowStepTranslation_workflowStepId_fkey" FOREIGN KEY ("workflowStepId") REFERENCES "public"."WorkflowStep"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "WorkflowStepTranslation" ADD CONSTRAINT "WorkflowStepTranslation_workflowStepId_fkey" FOREIGN KEY ("workflowStepId") REFERENCES "WorkflowStep"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20260121191700_add_eventtype_parentid_teamid_index/migration.sql b/packages/prisma/migrations/20260121191700_add_eventtype_parentid_teamid_index/migration.sql index dc443f0b554d02..ff62ddedc142eb 100644 --- a/packages/prisma/migrations/20260121191700_add_eventtype_parentid_teamid_index/migration.sql +++ b/packages/prisma/migrations/20260121191700_add_eventtype_parentid_teamid_index/migration.sql @@ -1,2 +1,2 @@ -- CreateIndex -CREATE INDEX "EventType_parentId_teamId_idx" ON "public"."EventType"("parentId", "teamId"); +CREATE INDEX "EventType_parentId_teamId_idx" ON "EventType"("parentId", "teamId"); diff --git a/packages/prisma/migrations/20260122133147_add_wrong_assignment_webhook/migration.sql b/packages/prisma/migrations/20260122133147_add_wrong_assignment_webhook/migration.sql index a26ee4f05895af..fdca4bbccd756d 100644 --- a/packages/prisma/migrations/20260122133147_add_wrong_assignment_webhook/migration.sql +++ b/packages/prisma/migrations/20260122133147_add_wrong_assignment_webhook/migration.sql @@ -1,2 +1,2 @@ -- AlterEnum -ALTER TYPE "public"."WebhookTriggerEvents" ADD VALUE 'WRONG_ASSIGNMENT_REPORT'; +ALTER TYPE "WebhookTriggerEvents" ADD VALUE 'WRONG_ASSIGNMENT_REPORT'; diff --git a/packages/prisma/migrations/20260122140703_add_credential_teamid_index/migration.sql b/packages/prisma/migrations/20260122140703_add_credential_teamid_index/migration.sql index 590aadb357221b..ba06921ba19147 100644 --- a/packages/prisma/migrations/20260122140703_add_credential_teamid_index/migration.sql +++ b/packages/prisma/migrations/20260122140703_add_credential_teamid_index/migration.sql @@ -1,2 +1,2 @@ -- CreateIndex -CREATE INDEX "Credential_teamId_idx" ON "public"."Credential"("teamId"); +CREATE INDEX "Credential_teamId_idx" ON "Credential"("teamId"); diff --git a/packages/prisma/migrations/20260122165837_add_encrypted_key_to_credential/migration.sql b/packages/prisma/migrations/20260122165837_add_encrypted_key_to_credential/migration.sql index ad0eed45f560a5..79e39bd29cc399 100644 --- a/packages/prisma/migrations/20260122165837_add_encrypted_key_to_credential/migration.sql +++ b/packages/prisma/migrations/20260122165837_add_encrypted_key_to_credential/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."Credential" ADD COLUMN "encryptedKey" TEXT; +ALTER TABLE "Credential" ADD COLUMN "encryptedKey" TEXT; diff --git a/packages/prisma/migrations/20260127035022_add_routing_trace_tables/migration.sql b/packages/prisma/migrations/20260127035022_add_routing_trace_tables/migration.sql index bf1eb7b93752f1..d39c526ef9498e 100644 --- a/packages/prisma/migrations/20260127035022_add_routing_trace_tables/migration.sql +++ b/packages/prisma/migrations/20260127035022_add_routing_trace_tables/migration.sql @@ -1,5 +1,5 @@ -- CreateTable -CREATE TABLE "public"."PendingRoutingTrace" ( +CREATE TABLE "PendingRoutingTrace" ( "id" TEXT NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "trace" JSONB NOT NULL, @@ -10,7 +10,7 @@ CREATE TABLE "public"."PendingRoutingTrace" ( ); -- CreateTable -CREATE TABLE "public"."RoutingTrace" ( +CREATE TABLE "RoutingTrace" ( "id" TEXT NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "trace" JSONB NOT NULL, @@ -23,43 +23,43 @@ CREATE TABLE "public"."RoutingTrace" ( ); -- CreateIndex -CREATE UNIQUE INDEX "PendingRoutingTrace_formResponseId_key" ON "public"."PendingRoutingTrace"("formResponseId"); +CREATE UNIQUE INDEX "PendingRoutingTrace_formResponseId_key" ON "PendingRoutingTrace"("formResponseId"); -- CreateIndex -CREATE UNIQUE INDEX "PendingRoutingTrace_queuedFormResponseId_key" ON "public"."PendingRoutingTrace"("queuedFormResponseId"); +CREATE UNIQUE INDEX "PendingRoutingTrace_queuedFormResponseId_key" ON "PendingRoutingTrace"("queuedFormResponseId"); -- CreateIndex -CREATE UNIQUE INDEX "RoutingTrace_formResponseId_key" ON "public"."RoutingTrace"("formResponseId"); +CREATE UNIQUE INDEX "RoutingTrace_formResponseId_key" ON "RoutingTrace"("formResponseId"); -- CreateIndex -CREATE UNIQUE INDEX "RoutingTrace_queuedFormResponseId_key" ON "public"."RoutingTrace"("queuedFormResponseId"); +CREATE UNIQUE INDEX "RoutingTrace_queuedFormResponseId_key" ON "RoutingTrace"("queuedFormResponseId"); -- CreateIndex -CREATE UNIQUE INDEX "RoutingTrace_bookingUid_key" ON "public"."RoutingTrace"("bookingUid"); +CREATE UNIQUE INDEX "RoutingTrace_bookingUid_key" ON "RoutingTrace"("bookingUid"); -- CreateIndex -CREATE UNIQUE INDEX "RoutingTrace_assignmentReasonId_key" ON "public"."RoutingTrace"("assignmentReasonId"); +CREATE UNIQUE INDEX "RoutingTrace_assignmentReasonId_key" ON "RoutingTrace"("assignmentReasonId"); -- AddForeignKey -ALTER TABLE "public"."PendingRoutingTrace" ADD CONSTRAINT "PendingRoutingTrace_formResponseId_fkey" FOREIGN KEY ("formResponseId") REFERENCES "public"."App_RoutingForms_FormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "PendingRoutingTrace" ADD CONSTRAINT "PendingRoutingTrace_formResponseId_fkey" FOREIGN KEY ("formResponseId") REFERENCES "App_RoutingForms_FormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."PendingRoutingTrace" ADD CONSTRAINT "PendingRoutingTrace_queuedFormResponseId_fkey" FOREIGN KEY ("queuedFormResponseId") REFERENCES "public"."App_RoutingForms_QueuedFormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "PendingRoutingTrace" ADD CONSTRAINT "PendingRoutingTrace_queuedFormResponseId_fkey" FOREIGN KEY ("queuedFormResponseId") REFERENCES "App_RoutingForms_QueuedFormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."RoutingTrace" ADD CONSTRAINT "RoutingTrace_formResponseId_fkey" FOREIGN KEY ("formResponseId") REFERENCES "public"."App_RoutingForms_FormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "RoutingTrace" ADD CONSTRAINT "RoutingTrace_formResponseId_fkey" FOREIGN KEY ("formResponseId") REFERENCES "App_RoutingForms_FormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."RoutingTrace" ADD CONSTRAINT "RoutingTrace_queuedFormResponseId_fkey" FOREIGN KEY ("queuedFormResponseId") REFERENCES "public"."App_RoutingForms_QueuedFormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "RoutingTrace" ADD CONSTRAINT "RoutingTrace_queuedFormResponseId_fkey" FOREIGN KEY ("queuedFormResponseId") REFERENCES "App_RoutingForms_QueuedFormResponse"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."RoutingTrace" ADD CONSTRAINT "RoutingTrace_bookingUid_fkey" FOREIGN KEY ("bookingUid") REFERENCES "public"."Booking"("uid") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "RoutingTrace" ADD CONSTRAINT "RoutingTrace_bookingUid_fkey" FOREIGN KEY ("bookingUid") REFERENCES "Booking"("uid") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."RoutingTrace" ADD CONSTRAINT "RoutingTrace_assignmentReasonId_fkey" FOREIGN KEY ("assignmentReasonId") REFERENCES "public"."AssignmentReason"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "RoutingTrace" ADD CONSTRAINT "RoutingTrace_assignmentReasonId_fkey" FOREIGN KEY ("assignmentReasonId") REFERENCES "AssignmentReason"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddCheckConstraint: Ensure at least one of formResponseId or queuedFormResponseId is set -ALTER TABLE "public"."PendingRoutingTrace" ADD CONSTRAINT "PendingRoutingTrace_at_least_one_response_id" CHECK ("formResponseId" IS NOT NULL OR "queuedFormResponseId" IS NOT NULL); +ALTER TABLE "PendingRoutingTrace" ADD CONSTRAINT "PendingRoutingTrace_at_least_one_response_id" CHECK ("formResponseId" IS NOT NULL OR "queuedFormResponseId" IS NOT NULL); -- AddCheckConstraint: Ensure at least one of formResponseId or queuedFormResponseId is set -ALTER TABLE "public"."RoutingTrace" ADD CONSTRAINT "RoutingTrace_at_least_one_response_id" CHECK ("formResponseId" IS NOT NULL OR "queuedFormResponseId" IS NOT NULL); +ALTER TABLE "RoutingTrace" ADD CONSTRAINT "RoutingTrace_at_least_one_response_id" CHECK ("formResponseId" IS NOT NULL OR "queuedFormResponseId" IS NOT NULL); diff --git a/packages/prisma/migrations/20260127140951_add_invoice_url_to_proration/migration.sql b/packages/prisma/migrations/20260127140951_add_invoice_url_to_proration/migration.sql index 3fb9f5e4ff59e6..cb60257737fb26 100644 --- a/packages/prisma/migrations/20260127140951_add_invoice_url_to_proration/migration.sql +++ b/packages/prisma/migrations/20260127140951_add_invoice_url_to_proration/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."MonthlyProration" ADD COLUMN "invoiceUrl" TEXT; +ALTER TABLE "MonthlyProration" ADD COLUMN "invoiceUrl" TEXT; diff --git a/packages/prisma/migrations/20260128170309_add_secondary_email_index/migration.sql b/packages/prisma/migrations/20260128170309_add_secondary_email_index/migration.sql index b011fffd6ddaf8..385679f53ba9c2 100644 --- a/packages/prisma/migrations/20260128170309_add_secondary_email_index/migration.sql +++ b/packages/prisma/migrations/20260128170309_add_secondary_email_index/migration.sql @@ -1,2 +1,2 @@ -- CreateIndex -CREATE INDEX IF NOT EXISTS "SecondaryEmail_email_emailVerified_idx" ON "public"."SecondaryEmail"("email", "emailVerified"); +CREATE INDEX IF NOT EXISTS "SecondaryEmail_email_emailVerified_idx" ON "SecondaryEmail"("email", "emailVerified"); diff --git a/packages/prisma/migrations/20260129205827_add_wrong_assignment_report_table/migration.sql b/packages/prisma/migrations/20260129205827_add_wrong_assignment_report_table/migration.sql index e1cb2ee462f116..992dbb9ab0d98f 100644 --- a/packages/prisma/migrations/20260129205827_add_wrong_assignment_report_table/migration.sql +++ b/packages/prisma/migrations/20260129205827_add_wrong_assignment_report_table/migration.sql @@ -1,8 +1,8 @@ -- CreateEnum -CREATE TYPE "public"."WrongAssignmentReportStatus" AS ENUM ('PENDING', 'REVIEWED', 'RESOLVED', 'DISMISSED'); +CREATE TYPE "WrongAssignmentReportStatus" AS ENUM ('PENDING', 'REVIEWED', 'RESOLVED', 'DISMISSED'); -- CreateTable -CREATE TABLE "public"."WrongAssignmentReport" ( +CREATE TABLE "WrongAssignmentReport" ( "id" UUID NOT NULL, "bookingUid" TEXT NOT NULL, "reportedById" INTEGER, @@ -10,7 +10,7 @@ CREATE TABLE "public"."WrongAssignmentReport" ( "additionalNotes" TEXT NOT NULL, "teamId" INTEGER, "routingFormId" TEXT, - "status" "public"."WrongAssignmentReportStatus" NOT NULL DEFAULT 'PENDING', + "status" "WrongAssignmentReportStatus" NOT NULL DEFAULT 'PENDING', "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL, @@ -18,31 +18,31 @@ CREATE TABLE "public"."WrongAssignmentReport" ( ); -- CreateIndex -CREATE UNIQUE INDEX "WrongAssignmentReport_bookingUid_key" ON "public"."WrongAssignmentReport"("bookingUid"); +CREATE UNIQUE INDEX "WrongAssignmentReport_bookingUid_key" ON "WrongAssignmentReport"("bookingUid"); -- CreateIndex -CREATE INDEX "WrongAssignmentReport_reportedById_idx" ON "public"."WrongAssignmentReport"("reportedById"); +CREATE INDEX "WrongAssignmentReport_reportedById_idx" ON "WrongAssignmentReport"("reportedById"); -- CreateIndex -CREATE INDEX "WrongAssignmentReport_teamId_idx" ON "public"."WrongAssignmentReport"("teamId"); +CREATE INDEX "WrongAssignmentReport_teamId_idx" ON "WrongAssignmentReport"("teamId"); -- CreateIndex -CREATE INDEX "WrongAssignmentReport_routingFormId_idx" ON "public"."WrongAssignmentReport"("routingFormId"); +CREATE INDEX "WrongAssignmentReport_routingFormId_idx" ON "WrongAssignmentReport"("routingFormId"); -- CreateIndex -CREATE INDEX "WrongAssignmentReport_status_idx" ON "public"."WrongAssignmentReport"("status"); +CREATE INDEX "WrongAssignmentReport_status_idx" ON "WrongAssignmentReport"("status"); -- CreateIndex -CREATE INDEX "WrongAssignmentReport_createdAt_idx" ON "public"."WrongAssignmentReport"("createdAt"); +CREATE INDEX "WrongAssignmentReport_createdAt_idx" ON "WrongAssignmentReport"("createdAt"); -- AddForeignKey -ALTER TABLE "public"."WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_bookingUid_fkey" FOREIGN KEY ("bookingUid") REFERENCES "public"."Booking"("uid") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_bookingUid_fkey" FOREIGN KEY ("bookingUid") REFERENCES "Booking"("uid") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_reportedById_fkey" FOREIGN KEY ("reportedById") REFERENCES "public"."users"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_reportedById_fkey" FOREIGN KEY ("reportedById") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "public"."Team"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "public"."WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_routingFormId_fkey" FOREIGN KEY ("routingFormId") REFERENCES "public"."App_RoutingForms_Form"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_routingFormId_fkey" FOREIGN KEY ("routingFormId") REFERENCES "App_RoutingForms_Form"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20260130043627_add_reviewed_fields_to_wrong_assignment_report/migration.sql b/packages/prisma/migrations/20260130043627_add_reviewed_fields_to_wrong_assignment_report/migration.sql index 6ff898f715c1b9..7e91c7e9b95edc 100644 --- a/packages/prisma/migrations/20260130043627_add_reviewed_fields_to_wrong_assignment_report/migration.sql +++ b/packages/prisma/migrations/20260130043627_add_reviewed_fields_to_wrong_assignment_report/migration.sql @@ -1,9 +1,9 @@ -- AlterTable -ALTER TABLE "public"."WrongAssignmentReport" ADD COLUMN "reviewedAt" TIMESTAMP(3), +ALTER TABLE "WrongAssignmentReport" ADD COLUMN "reviewedAt" TIMESTAMP(3), ADD COLUMN "reviewedById" INTEGER; -- CreateIndex -CREATE INDEX "WrongAssignmentReport_reviewedById_idx" ON "public"."WrongAssignmentReport"("reviewedById"); +CREATE INDEX "WrongAssignmentReport_reviewedById_idx" ON "WrongAssignmentReport"("reviewedById"); -- AddForeignKey -ALTER TABLE "public"."WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_reviewedById_fkey" FOREIGN KEY ("reviewedById") REFERENCES "public"."users"("id") ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE "WrongAssignmentReport" ADD CONSTRAINT "WrongAssignmentReport_reviewedById_fkey" FOREIGN KEY ("reviewedById") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/packages/prisma/migrations/20260130100000_add_high_water_mark_fields/migration.sql b/packages/prisma/migrations/20260130100000_add_high_water_mark_fields/migration.sql index 5f8d2d62b14265..e1182773644032 100644 --- a/packages/prisma/migrations/20260130100000_add_high_water_mark_fields/migration.sql +++ b/packages/prisma/migrations/20260130100000_add_high_water_mark_fields/migration.sql @@ -6,6 +6,6 @@ ADD COLUMN "highWaterMarkPeriodStart" TIMESTAMP(3); ALTER TABLE "OrganizationBilling" ADD COLUMN "highWaterMark" INTEGER, ADD COLUMN "highWaterMarkPeriodStart" TIMESTAMP(3); -INSERT INTO "public"."Feature" ("slug", "enabled", "description", "type", "stale", "lastUsedAt", "createdAt", "updatedAt") +INSERT INTO "Feature" ("slug", "enabled", "description", "type", "stale", "lastUsedAt", "createdAt", "updatedAt") VALUES ('hwm-seating', false, 'High water mark seating for monthly billing - charges for peak seats used during billing period', 'RELEASE', false, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) ON CONFLICT ("slug") DO NOTHING; diff --git a/packages/prisma/migrations/20260201053520_add_redirect_url_on_no_routing_form_response/migration.sql b/packages/prisma/migrations/20260201053520_add_redirect_url_on_no_routing_form_response/migration.sql index 57ba25c19b512d..a2b64ddf1fcf24 100644 --- a/packages/prisma/migrations/20260201053520_add_redirect_url_on_no_routing_form_response/migration.sql +++ b/packages/prisma/migrations/20260201053520_add_redirect_url_on_no_routing_form_response/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "public"."EventType" ADD COLUMN "redirectUrlOnNoRoutingFormResponse" TEXT; +ALTER TABLE "EventType" ADD COLUMN "redirectUrlOnNoRoutingFormResponse" TEXT; diff --git a/packages/prisma/migrations/20260305043434_remove_routing_forms/migration.sql b/packages/prisma/migrations/20260305043434_remove_routing_forms/migration.sql index c2d3e08afe06e0..8d3d3e8fb57e73 100644 --- a/packages/prisma/migrations/20260305043434_remove_routing_forms/migration.sql +++ b/packages/prisma/migrations/20260305043434_remove_routing_forms/migration.sql @@ -82,141 +82,141 @@ DROP FUNCTION IF EXISTS trigger_cleanup_routing_form_response_denormalized_track DROP FUNCTION IF EXISTS calculate_booking_status_order(text); -- Pre-migration cleanup to allow enum variant removal -DELETE FROM "public"."AssignmentReason" WHERE "reasonEnum" IN ('ROUTING_FORM_ROUTING', 'ROUTING_FORM_ROUTING_FALLBACK'); +DELETE FROM "AssignmentReason" WHERE "reasonEnum" IN ('ROUTING_FORM_ROUTING', 'ROUTING_FORM_ROUTING_FALLBACK'); -UPDATE "public"."Webhook" -SET "eventTriggers" = array_remove("eventTriggers", 'ROUTING_FORM_FALLBACK_HIT'::"public"."WebhookTriggerEvents") -WHERE "eventTriggers" @> ARRAY['ROUTING_FORM_FALLBACK_HIT']::"public"."WebhookTriggerEvents"[]; +UPDATE "Webhook" +SET "eventTriggers" = array_remove("eventTriggers", 'ROUTING_FORM_FALLBACK_HIT'::"WebhookTriggerEvents") +WHERE "eventTriggers" @> ARRAY['ROUTING_FORM_FALLBACK_HIT']::"WebhookTriggerEvents"[]; -DELETE FROM "public"."Workflow" WHERE "type" = 'ROUTING_FORM'; +DELETE FROM "Workflow" WHERE "type" = 'ROUTING_FORM'; -- AlterEnum BEGIN; -CREATE TYPE "public"."AssignmentReasonEnum_new" AS ENUM ('REASSIGNED', 'RR_REASSIGNED', 'REROUTED', 'SALESFORCE_ASSIGNMENT'); -ALTER TABLE "public"."AssignmentReason" ALTER COLUMN "reasonEnum" TYPE "public"."AssignmentReasonEnum_new" USING ("reasonEnum"::text::"public"."AssignmentReasonEnum_new"); -ALTER TYPE "public"."AssignmentReasonEnum" RENAME TO "AssignmentReasonEnum_old"; -ALTER TYPE "public"."AssignmentReasonEnum_new" RENAME TO "AssignmentReasonEnum"; -DROP TYPE "public"."AssignmentReasonEnum_old"; +CREATE TYPE "AssignmentReasonEnum_new" AS ENUM ('REASSIGNED', 'RR_REASSIGNED', 'REROUTED', 'SALESFORCE_ASSIGNMENT'); +ALTER TABLE "AssignmentReason" ALTER COLUMN "reasonEnum" TYPE "AssignmentReasonEnum_new" USING ("reasonEnum"::text::"AssignmentReasonEnum_new"); +ALTER TYPE "AssignmentReasonEnum" RENAME TO "AssignmentReasonEnum_old"; +ALTER TYPE "AssignmentReasonEnum_new" RENAME TO "AssignmentReasonEnum"; +DROP TYPE "AssignmentReasonEnum_old"; COMMIT; -- AlterEnum BEGIN; -CREATE TYPE "public"."WebhookTriggerEvents_new" AS ENUM ('BOOKING_CREATED', 'BOOKING_PAYMENT_INITIATED', 'BOOKING_PAID', 'BOOKING_RESCHEDULED', 'BOOKING_REQUESTED', 'BOOKING_CANCELLED', 'BOOKING_REJECTED', 'BOOKING_NO_SHOW_UPDATED', 'FORM_SUBMITTED', 'MEETING_ENDED', 'MEETING_STARTED', 'RECORDING_READY', 'INSTANT_MEETING', 'RECORDING_TRANSCRIPTION_GENERATED', 'OOO_CREATED', 'AFTER_HOSTS_CAL_VIDEO_NO_SHOW', 'AFTER_GUESTS_CAL_VIDEO_NO_SHOW', 'FORM_SUBMITTED_NO_EVENT', 'DELEGATION_CREDENTIAL_ERROR', 'WRONG_ASSIGNMENT_REPORT'); -ALTER TABLE "public"."Webhook" ALTER COLUMN "eventTriggers" TYPE "public"."WebhookTriggerEvents_new"[] USING ("eventTriggers"::text::"public"."WebhookTriggerEvents_new"[]); -ALTER TYPE "public"."WebhookTriggerEvents" RENAME TO "WebhookTriggerEvents_old"; -ALTER TYPE "public"."WebhookTriggerEvents_new" RENAME TO "WebhookTriggerEvents"; -DROP TYPE "public"."WebhookTriggerEvents_old"; +CREATE TYPE "WebhookTriggerEvents_new" AS ENUM ('BOOKING_CREATED', 'BOOKING_PAYMENT_INITIATED', 'BOOKING_PAID', 'BOOKING_RESCHEDULED', 'BOOKING_REQUESTED', 'BOOKING_CANCELLED', 'BOOKING_REJECTED', 'BOOKING_NO_SHOW_UPDATED', 'FORM_SUBMITTED', 'MEETING_ENDED', 'MEETING_STARTED', 'RECORDING_READY', 'INSTANT_MEETING', 'RECORDING_TRANSCRIPTION_GENERATED', 'OOO_CREATED', 'AFTER_HOSTS_CAL_VIDEO_NO_SHOW', 'AFTER_GUESTS_CAL_VIDEO_NO_SHOW', 'FORM_SUBMITTED_NO_EVENT', 'DELEGATION_CREDENTIAL_ERROR', 'WRONG_ASSIGNMENT_REPORT'); +ALTER TABLE "Webhook" ALTER COLUMN "eventTriggers" TYPE "WebhookTriggerEvents_new"[] USING ("eventTriggers"::text::"WebhookTriggerEvents_new"[]); +ALTER TYPE "WebhookTriggerEvents" RENAME TO "WebhookTriggerEvents_old"; +ALTER TYPE "WebhookTriggerEvents_new" RENAME TO "WebhookTriggerEvents"; +DROP TYPE "WebhookTriggerEvents_old"; COMMIT; -- AlterEnum BEGIN; -CREATE TYPE "public"."WorkflowType_new" AS ENUM ('EVENT_TYPE'); -ALTER TABLE "public"."Workflow" ALTER COLUMN "type" DROP DEFAULT; -ALTER TABLE "public"."Workflow" ALTER COLUMN "type" TYPE "public"."WorkflowType_new" USING ("type"::text::"public"."WorkflowType_new"); -ALTER TYPE "public"."WorkflowType" RENAME TO "WorkflowType_old"; -ALTER TYPE "public"."WorkflowType_new" RENAME TO "WorkflowType"; -DROP TYPE "public"."WorkflowType_old"; -ALTER TABLE "public"."Workflow" ALTER COLUMN "type" SET DEFAULT 'EVENT_TYPE'; +CREATE TYPE "WorkflowType_new" AS ENUM ('EVENT_TYPE'); +ALTER TABLE "Workflow" ALTER COLUMN "type" DROP DEFAULT; +ALTER TABLE "Workflow" ALTER COLUMN "type" TYPE "WorkflowType_new" USING ("type"::text::"WorkflowType_new"); +ALTER TYPE "WorkflowType" RENAME TO "WorkflowType_old"; +ALTER TYPE "WorkflowType_new" RENAME TO "WorkflowType"; +DROP TYPE "WorkflowType_old"; +ALTER TABLE "Workflow" ALTER COLUMN "type" SET DEFAULT 'EVENT_TYPE'; COMMIT; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_Form" DROP CONSTRAINT "App_RoutingForms_Form_teamId_fkey"; +ALTER TABLE "App_RoutingForms_Form" DROP CONSTRAINT "App_RoutingForms_Form_teamId_fkey"; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_Form" DROP CONSTRAINT "App_RoutingForms_Form_updatedById_fkey"; +ALTER TABLE "App_RoutingForms_Form" DROP CONSTRAINT "App_RoutingForms_Form_updatedById_fkey"; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_Form" DROP CONSTRAINT "App_RoutingForms_Form_userId_fkey"; +ALTER TABLE "App_RoutingForms_Form" DROP CONSTRAINT "App_RoutingForms_Form_userId_fkey"; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_FormResponse" DROP CONSTRAINT "App_RoutingForms_FormResponse_formId_fkey"; +ALTER TABLE "App_RoutingForms_FormResponse" DROP CONSTRAINT "App_RoutingForms_FormResponse_formId_fkey"; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_FormResponse" DROP CONSTRAINT "App_RoutingForms_FormResponse_routedToBookingUid_fkey"; +ALTER TABLE "App_RoutingForms_FormResponse" DROP CONSTRAINT "App_RoutingForms_FormResponse_routedToBookingUid_fkey"; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_IncompleteBookingActions" DROP CONSTRAINT "App_RoutingForms_IncompleteBookingActions_formId_fkey"; +ALTER TABLE "App_RoutingForms_IncompleteBookingActions" DROP CONSTRAINT "App_RoutingForms_IncompleteBookingActions_formId_fkey"; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_QueuedFormResponse" DROP CONSTRAINT "App_RoutingForms_QueuedFormResponse_actualResponseId_fkey"; +ALTER TABLE "App_RoutingForms_QueuedFormResponse" DROP CONSTRAINT "App_RoutingForms_QueuedFormResponse_actualResponseId_fkey"; -- DropForeignKey -ALTER TABLE "public"."App_RoutingForms_QueuedFormResponse" DROP CONSTRAINT "App_RoutingForms_QueuedFormResponse_formId_fkey"; +ALTER TABLE "App_RoutingForms_QueuedFormResponse" DROP CONSTRAINT "App_RoutingForms_QueuedFormResponse_formId_fkey"; -- DropForeignKey -ALTER TABLE "public"."PendingRoutingTrace" DROP CONSTRAINT "PendingRoutingTrace_formResponseId_fkey"; +ALTER TABLE "PendingRoutingTrace" DROP CONSTRAINT "PendingRoutingTrace_formResponseId_fkey"; -- DropForeignKey -ALTER TABLE "public"."PendingRoutingTrace" DROP CONSTRAINT "PendingRoutingTrace_queuedFormResponseId_fkey"; +ALTER TABLE "PendingRoutingTrace" DROP CONSTRAINT "PendingRoutingTrace_queuedFormResponseId_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingFormResponseDenormalized" DROP CONSTRAINT "RoutingFormResponseDenormalized_bookingId_fkey"; +ALTER TABLE "RoutingFormResponseDenormalized" DROP CONSTRAINT "RoutingFormResponseDenormalized_bookingId_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingFormResponseDenormalized" DROP CONSTRAINT "RoutingFormResponseDenormalized_id_fkey"; +ALTER TABLE "RoutingFormResponseDenormalized" DROP CONSTRAINT "RoutingFormResponseDenormalized_id_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingFormResponseField" DROP CONSTRAINT "RoutingFormResponseField_responseId_fkey"; +ALTER TABLE "RoutingFormResponseField" DROP CONSTRAINT "RoutingFormResponseField_responseId_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingFormResponseField" DROP CONSTRAINT "RoutingFormResponseField_response_fkey"; +ALTER TABLE "RoutingFormResponseField" DROP CONSTRAINT "RoutingFormResponseField_response_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingTrace" DROP CONSTRAINT "RoutingTrace_assignmentReasonId_fkey"; +ALTER TABLE "RoutingTrace" DROP CONSTRAINT "RoutingTrace_assignmentReasonId_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingTrace" DROP CONSTRAINT "RoutingTrace_bookingUid_fkey"; +ALTER TABLE "RoutingTrace" DROP CONSTRAINT "RoutingTrace_bookingUid_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingTrace" DROP CONSTRAINT "RoutingTrace_formResponseId_fkey"; +ALTER TABLE "RoutingTrace" DROP CONSTRAINT "RoutingTrace_formResponseId_fkey"; -- DropForeignKey -ALTER TABLE "public"."RoutingTrace" DROP CONSTRAINT "RoutingTrace_queuedFormResponseId_fkey"; +ALTER TABLE "RoutingTrace" DROP CONSTRAINT "RoutingTrace_queuedFormResponseId_fkey"; -- DropForeignKey -ALTER TABLE "public"."WorkflowsOnRoutingForms" DROP CONSTRAINT "WorkflowsOnRoutingForms_routingFormId_fkey"; +ALTER TABLE "WorkflowsOnRoutingForms" DROP CONSTRAINT "WorkflowsOnRoutingForms_routingFormId_fkey"; -- DropForeignKey -ALTER TABLE "public"."WorkflowsOnRoutingForms" DROP CONSTRAINT "WorkflowsOnRoutingForms_workflowId_fkey"; +ALTER TABLE "WorkflowsOnRoutingForms" DROP CONSTRAINT "WorkflowsOnRoutingForms_workflowId_fkey"; -- DropForeignKey -ALTER TABLE "public"."WrongAssignmentReport" DROP CONSTRAINT "WrongAssignmentReport_routingFormId_fkey"; +ALTER TABLE "WrongAssignmentReport" DROP CONSTRAINT "WrongAssignmentReport_routingFormId_fkey"; -- DropIndex -DROP INDEX "public"."WrongAssignmentReport_routingFormId_idx"; +DROP INDEX "WrongAssignmentReport_routingFormId_idx"; -- AlterTable -ALTER TABLE "public"."EventType" DROP COLUMN "redirectUrlOnNoRoutingFormResponse"; +ALTER TABLE "EventType" DROP COLUMN "redirectUrlOnNoRoutingFormResponse"; -- AlterTable -ALTER TABLE "public"."WrongAssignmentReport" DROP COLUMN "routingFormId"; +ALTER TABLE "WrongAssignmentReport" DROP COLUMN "routingFormId"; -- DropTable -DROP TABLE "public"."App_RoutingForms_Form"; +DROP TABLE "App_RoutingForms_Form"; -- DropTable -DROP TABLE "public"."App_RoutingForms_FormResponse"; +DROP TABLE "App_RoutingForms_FormResponse"; -- DropTable -DROP TABLE "public"."App_RoutingForms_IncompleteBookingActions"; +DROP TABLE "App_RoutingForms_IncompleteBookingActions"; -- DropTable -DROP TABLE "public"."App_RoutingForms_QueuedFormResponse"; +DROP TABLE "App_RoutingForms_QueuedFormResponse"; -- DropTable -DROP TABLE "public"."PendingRoutingTrace"; +DROP TABLE "PendingRoutingTrace"; -- DropTable -DROP TABLE "public"."RoutingFormResponseDenormalized"; +DROP TABLE "RoutingFormResponseDenormalized"; -- DropTable -DROP TABLE "public"."RoutingFormResponseField"; +DROP TABLE "RoutingFormResponseField"; -- DropTable -DROP TABLE "public"."RoutingTrace"; +DROP TABLE "RoutingTrace"; -- DropTable -DROP TABLE "public"."WorkflowsOnRoutingForms"; +DROP TABLE "WorkflowsOnRoutingForms"; -- DropEnum -DROP TYPE "public"."IncompleteBookingActionType"; +DROP TYPE "IncompleteBookingActionType"; diff --git a/packages/prisma/migrations/20260430000000_drop_instant_meeting_webhook_trigger/migration.sql b/packages/prisma/migrations/20260430000000_drop_instant_meeting_webhook_trigger/migration.sql index 6897fe0ed31614..06d03fda17b563 100644 --- a/packages/prisma/migrations/20260430000000_drop_instant_meeting_webhook_trigger/migration.sql +++ b/packages/prisma/migrations/20260430000000_drop_instant_meeting_webhook_trigger/migration.sql @@ -1,9 +1,9 @@ BEGIN; -UPDATE "public"."Webhook" -SET "eventTriggers" = array_remove("eventTriggers", 'INSTANT_MEETING'::"public"."WebhookTriggerEvents") -WHERE "eventTriggers" @> ARRAY['INSTANT_MEETING']::"public"."WebhookTriggerEvents"[]; +UPDATE "Webhook" +SET "eventTriggers" = array_remove("eventTriggers", 'INSTANT_MEETING'::"WebhookTriggerEvents") +WHERE "eventTriggers" @> ARRAY['INSTANT_MEETING']::"WebhookTriggerEvents"[]; -CREATE TYPE "public"."WebhookTriggerEvents_new" AS ENUM ( +CREATE TYPE "WebhookTriggerEvents_new" AS ENUM ( 'BOOKING_CREATED', 'BOOKING_PAYMENT_INITIATED', 'BOOKING_PAID', @@ -24,10 +24,10 @@ CREATE TYPE "public"."WebhookTriggerEvents_new" AS ENUM ( 'DELEGATION_CREDENTIAL_ERROR', 'WRONG_ASSIGNMENT_REPORT' ); -ALTER TABLE "public"."Webhook" -ALTER COLUMN "eventTriggers" TYPE "public"."WebhookTriggerEvents_new"[] -USING ("eventTriggers"::text::"public"."WebhookTriggerEvents_new"[]); -ALTER TYPE "public"."WebhookTriggerEvents" RENAME TO "WebhookTriggerEvents_old"; -ALTER TYPE "public"."WebhookTriggerEvents_new" RENAME TO "WebhookTriggerEvents"; -DROP TYPE "public"."WebhookTriggerEvents_old"; +ALTER TABLE "Webhook" +ALTER COLUMN "eventTriggers" TYPE "WebhookTriggerEvents_new"[] +USING ("eventTriggers"::text::"WebhookTriggerEvents_new"[]); +ALTER TYPE "WebhookTriggerEvents" RENAME TO "WebhookTriggerEvents_old"; +ALTER TYPE "WebhookTriggerEvents_new" RENAME TO "WebhookTriggerEvents"; +DROP TYPE "WebhookTriggerEvents_old"; COMMIT; From f9ada42f0a24595451da00fe5b00e54eb92d890b Mon Sep 17 00:00:00 2001 From: JOY <5027251+JOY@users.noreply.github.com> Date: Sat, 22 Aug 2026 13:13:18 +0700 Subject: [PATCH 2/3] fix(prisma): configure PrismaPg adapter with schema from DATABASE_URL Co-authored-by: Cursor --- .../src/modules/prisma/prisma-read.service.ts | 18 +++++++++++++-- .../modules/prisma/prisma-write.service.ts | 18 +++++++++++++-- packages/prisma/index.ts | 22 +++++++++++++++++-- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/apps/api/v2/src/modules/prisma/prisma-read.service.ts b/apps/api/v2/src/modules/prisma/prisma-read.service.ts index 1d0b935918ac8c..3581af92ec5f61 100644 --- a/apps/api/v2/src/modules/prisma/prisma-read.service.ts +++ b/apps/api/v2/src/modules/prisma/prisma-read.service.ts @@ -6,6 +6,17 @@ import { Pool } from "pg"; const DB_MAX_POOL_CONNECTION = 10; +function getSchemaFromUrl(url: string | undefined): string | undefined { + if (!url) return undefined; + try { + const parsed = new URL(url.replace(/^postgresql:\/\//, "http://").replace(/^postgres:\/\//, "http://")); + return parsed.searchParams.get("schema") || undefined; + } catch { + const match = url.match(/[?&]schema=([^&]+)/); + return match ? match[1] : undefined; + } +} + @Injectable() export class PrismaReadService implements OnModuleInit, OnModuleDestroy { private logger = new Logger("PrismaReadService"); @@ -39,6 +50,9 @@ export class PrismaReadService implements OnModuleInit, OnModuleDestroy { const isE2E = options.e2e ?? false; const usePool = options.usePool ?? true; + const schema = getSchemaFromUrl(dbUrl); + const adapterOptions = schema ? { schema } : undefined; + if (usePool) { let maxReadConnections = options.maxReadConnections ?? DB_MAX_POOL_CONNECTION; if (isE2E) { @@ -51,10 +65,10 @@ export class PrismaReadService implements OnModuleInit, OnModuleDestroy { idleTimeoutMillis: 300000, }); - const adapter = new PrismaPg(this.pool); + const adapter = new PrismaPg(this.pool, adapterOptions); this.prisma = new PrismaClient({ adapter }); } else { - const adapter = new PrismaPg({ connectionString: dbUrl }); + const adapter = new PrismaPg({ connectionString: dbUrl }, adapterOptions); this.prisma = new PrismaClient({ adapter, }); diff --git a/apps/api/v2/src/modules/prisma/prisma-write.service.ts b/apps/api/v2/src/modules/prisma/prisma-write.service.ts index 91e659079cfbea..13dc1f180c9d20 100644 --- a/apps/api/v2/src/modules/prisma/prisma-write.service.ts +++ b/apps/api/v2/src/modules/prisma/prisma-write.service.ts @@ -14,6 +14,17 @@ export interface PrismaServiceOptions { type: "main" | "worker"; } +function getSchemaFromUrl(url: string | undefined): string | undefined { + if (!url) return undefined; + try { + const parsed = new URL(url.replace(/^postgresql:\/\//, "http://").replace(/^postgres:\/\//, "http://")); + return parsed.searchParams.get("schema") || undefined; + } catch { + const match = url.match(/[?&]schema=([^&]+)/); + return match ? match[1] : undefined; + } +} + @Injectable() export class PrismaWriteService implements OnModuleInit, OnModuleDestroy { private logger = new Logger("PrismaWriteService"); @@ -45,6 +56,9 @@ export class PrismaWriteService implements OnModuleInit, OnModuleDestroy { const isE2E = options.e2e ?? false; const usePool = options.usePool ?? true; + const schema = getSchemaFromUrl(dbUrl); + const adapterOptions = schema ? { schema } : undefined; + if (usePool) { let maxWriteConnections = options.maxWriteConnections ?? DB_MAX_POOL_CONNECTION; if (isE2E) { @@ -57,10 +71,10 @@ export class PrismaWriteService implements OnModuleInit, OnModuleDestroy { idleTimeoutMillis: 300000, }); - const adapter = new PrismaPg(this.pool); + const adapter = new PrismaPg(this.pool, adapterOptions); this.prisma = new PrismaClient({ adapter }); } else { - const adapter = new PrismaPg({ connectionString: dbUrl }); + const adapter = new PrismaPg({ connectionString: dbUrl }, adapterOptions); this.prisma = new PrismaClient({ adapter, }); diff --git a/packages/prisma/index.ts b/packages/prisma/index.ts index 1c7a844a55ded6..c5d73fe56dfde6 100644 --- a/packages/prisma/index.ts +++ b/packages/prisma/index.ts @@ -7,7 +7,21 @@ import { excludeLockedUsersExtension } from "./extensions/exclude-locked-users"; import { excludePendingPaymentsExtension } from "./extensions/exclude-pending-payment-teams"; import { PrismaClient, type Prisma } from "./generated/prisma/client"; +function getSchemaFromUrl(url: string | undefined): string | undefined { + if (!url) return undefined; + try { + const parsed = new URL(url.replace(/^postgresql:\/\//, "http://").replace(/^postgres:\/\//, "http://")); + return parsed.searchParams.get("schema") || undefined; + } catch { + const match = url.match(/[?&]schema=([^&]+)/); + return match ? match[1] : undefined; + } +} + const connectionString = process.env.DATABASE_URL || ""; +const schema = getSchemaFromUrl(connectionString); +const adapterOptions = schema ? { schema } : undefined; + const pool = process.env.USE_POOL === "true" || process.env.USE_POOL === "1" ? new Pool({ @@ -17,7 +31,7 @@ const pool = }) : undefined; -const adapter = pool ? new PrismaPg(pool) : new PrismaPg({ connectionString }); +const adapter = pool ? new PrismaPg(pool, adapterOptions) : new PrismaPg({ connectionString }, adapterOptions); const prismaOptions: Prisma.PrismaClientOptions = { adapter, }; @@ -52,7 +66,11 @@ export const customPrisma = (options?: Prisma.PrismaClientOptions) => { if (options?.datasources?.db?.url) { const customConnectionString = options.datasources.db.url; - const customAdapter = new PrismaPg({ connectionString: customConnectionString }); + const customSchema = getSchemaFromUrl(customConnectionString); + const customAdapter = new PrismaPg( + { connectionString: customConnectionString }, + customSchema ? { schema: customSchema } : undefined + ); const { datasources: _datasources, ...restOptions } = options; finalOptions = { From 583c417ca58906570f8e21c0d400a4547d49db38 Mon Sep 17 00:00:00 2001 From: JOY <5027251+JOY@users.noreply.github.com> Date: Sat, 22 Aug 2026 15:36:47 +0700 Subject: [PATCH 3/3] feat(ci): add GitHub Actions workflow to build and push Docker image to GHCR Co-authored-by: Cursor --- .github/workflows/deploy-docker.yml | 52 +++++++++++++++++++++++++++++ scripts/start.sh | 4 ++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-docker.yml diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml new file mode 100644 index 00000000000000..8fee4c3d8eb581 --- /dev/null +++ b/.github/workflows/deploy-docker.yml @@ -0,0 +1,52 @@ +name: Build and Push Crove Cal Docker Image + +on: + push: + branches: + - dev + - main + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Downcase repository owner for image name + id: image-name + run: | + IMAGE_NAME="ghcr.io/${{ github.repository }}" + echo "image_name=${IMAGE_NAME,,}" >> $GITHUB_OUTPUT + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ steps.image-name.outputs.image_name }}:latest + ${{ steps.image-name.outputs.image_name }}:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000 + NEXT_PUBLIC_API_V2_URL=http://localhost:5555/api/v2 + NEXT_PUBLIC_LICENSE_CONSENT=agree + CALCOM_TELEMETRY_DISABLED=1 diff --git a/scripts/start.sh b/scripts/start.sh index 6e649a97e5be1a..334010a375820a 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -5,7 +5,9 @@ set -x # NOTE: if these values are the same, this will be skipped. scripts/replace-placeholder.sh "$BUILT_NEXT_PUBLIC_WEBAPP_URL" "$NEXT_PUBLIC_WEBAPP_URL" -scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up" +if [ -n "$DATABASE_HOST" ]; then + scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up" +fi npx prisma migrate deploy --schema /calcom/packages/prisma/schema.prisma npx ts-node --transpile-only /calcom/scripts/seed-app-store.ts yarn start