fix(DB): allow null session_id for assist_records(session_id) (#1965)

This commit is contained in:
Kraiem Taha Yassine 2024-03-17 15:07:23 +01:00 committed by GitHub
parent 3eb9f5cc52
commit 902ec87d7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -19,6 +19,8 @@ $fn_def$, :'next_version')
--
DROP FUNCTION IF EXISTS events.funnel(steps integer[], m integer);
ALTER TABLE public.assist_records
ALTER COLUMN session_id DROP NOT NULL;
COMMIT;

View file

@ -1251,7 +1251,7 @@ CREATE TABLE public.assist_records
record_id integer generated BY DEFAULT AS IDENTITY PRIMARY KEY,
project_id integer NOT NULL REFERENCES public.projects (project_id) ON DELETE CASCADE,
user_id integer NOT NULL REFERENCES public.users (user_id) ON DELETE SET NULL,
session_id bigint NOT NULL REFERENCES public.sessions (session_id) ON DELETE SET NULL,
session_id bigint NULL REFERENCES public.sessions (session_id) ON DELETE SET NULL,
created_at bigint NOT NULL DEFAULT (EXTRACT(EPOCH FROM now() at time zone 'utc') * 1000)::bigint,
deleted_at timestamp without time zone NULL DEFAULT NULL,
name text NOT NULL,