mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
fix migration bug
This commit is contained in:
parent
cbeefe733f
commit
b36d61609d
1 changed files with 5 additions and 5 deletions
|
|
@ -1,11 +1,11 @@
|
|||
-- AlterTable
|
||||
ALTER TABLE "website_event" ADD COLUMN "session_id" UUID NULL;
|
||||
ALTER TABLE "website_event" ADD COLUMN "visit_id" UUID NULL;
|
||||
|
||||
UPDATE "website_event"
|
||||
SET session_id = uuid_in(overlay(overlay(md5(CONCAT(session_id::text, to_char(date_trunc('hour', created_at), 'YYYY-MM-DD HH24:00:00'))) placing '4' from 13) placing '8' from 17)::cstring)
|
||||
WHERE session_id IS NULL;
|
||||
SET visit_id = uuid_in(overlay(overlay(md5(CONCAT(session_id::text, to_char(date_trunc('hour', created_at), 'YYYY-MM-DD HH24:00:00'))) placing '4' from 13) placing '8' from 17)::cstring)
|
||||
WHERE visit_id IS NULL;
|
||||
|
||||
ALTER TABLE "website_event" ALTER COLUMN "session_id" SET NOT NULL;
|
||||
ALTER TABLE "website_event" ALTER COLUMN "visit_id" SET NOT NULL;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "website_event_visit_id_idx" ON "website_event"("visit_id");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue