Files
0968fc56eb feat: add utm tracking on booking (#19965)
* add tracking to booking + pass to handleNewBooking

* save tracking to booking

* return undefined if no utm params

* add test for handleNewBooking

* fix type error in test

* refactor code

* code clean up

* code clean up

* add missing import

* fix type import

* add utm params to insights (#20063)

* add utm params to insights

* remove duplicates

* remove duplicate columns

---------

Co-authored-by: CarinaWolli <[email protected]>

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Omar López <[email protected]>
2025-03-14 08:21:55 -07:00

19 lines
532 B
SQL

-- CreateTable
CREATE TABLE "Tracking" (
"id" SERIAL NOT NULL,
"bookingId" INTEGER NOT NULL,
"utm_source" TEXT,
"utm_medium" TEXT,
"utm_campaign" TEXT,
"utm_term" TEXT,
"utm_content" TEXT,
CONSTRAINT "Tracking_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Tracking_bookingId_key" ON "Tracking"("bookingId");
-- AddForeignKey
ALTER TABLE "Tracking" ADD CONSTRAINT "Tracking_bookingId_fkey" FOREIGN KEY ("bookingId") REFERENCES "Booking"("id") ON DELETE CASCADE ON UPDATE CASCADE;