Compare commits

..

No commits in common. "1825524e95af5107538a4c4a57917b5948db5885" and "6799bd113a1c3ee4306316d612aeb30d1d1b9b75" have entirely different histories.

2 changed files with 0 additions and 26 deletions

View file

@ -71,28 +71,3 @@ CREATE INDEX "pixel_team_id_idx" ON "pixel"("team_id");
-- CreateIndex
CREATE INDEX "pixel_created_at_idx" ON "pixel"("created_at");
-- DataMigration
UPDATE "report" SET parameters = parameters - 'websiteId' - 'dateRange' WHERE type = 'funnel';
UPDATE "report" SET type = 'goal' WHERE type = 'goals';
INSERT INTO "report" (report_id, user_id, website_id, type, name, description, parameters, created_at, updated_at)
SELECT gen_random_uuid(),
user_id,
website_id,
'goal',
concat(name, ' - ', elem ->> 'value'),
description,
jsonb_build_object(
'type', CASE WHEN elem ->> 'type' = 'url' THEN 'path'
ELSE elem ->> 'type' END,
'value', elem ->> 'value'
) AS parameters,
created_at,
updated_at
FROM "report"
CROSS JOIN LATERAL jsonb_array_elements(parameters -> 'goals') elem
WHERE elem ->> 'type' IN ('event', 'url')
and type = 'goal';
DELETE FROM "report" WHERE parameters ? 'goals' and type = 'goal';

View file

@ -59,7 +59,6 @@ export {
Funnel,
Lightbulb,
Lightning,
Location,
Magnet,
Money,
Network,