Fixes for HistoryUUID

This commit is contained in:
Magnus Åhall 2026-06-10 08:03:33 +02:00
parent be7f5dbf30
commit 3e8d5b6d9a
7 changed files with 176 additions and 18 deletions

View file

@ -257,7 +257,7 @@ $$;
CREATE TABLE public.client (
id integer NOT NULL,
user_id integer NOT NULL,
client_uuid character(36) DEFAULT ''::bpchar NOT NULL,
client_uuid uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
description character varying DEFAULT ''::character varying NOT NULL
);
@ -302,8 +302,8 @@ CREATE SEQUENCE public.node_updates
CREATE TABLE public.node (
id integer NOT NULL,
user_id integer NOT NULL,
uuid character(36) DEFAULT gen_random_uuid() NOT NULL,
parent_uuid character(36),
"uuid" uuid DEFAULT gen_random_uuid() NOT NULL,
parent_uuid uuid,
created timestamp with time zone DEFAULT now() NOT NULL,
updated timestamp with time zone DEFAULT now() NOT NULL,
deleted timestamp with time zone,
@ -315,7 +315,7 @@ CREATE TABLE public.node (
content_encrypted text DEFAULT ''::text NOT NULL,
markdown boolean DEFAULT false NOT NULL,
history boolean DEFAULT false NOT NULL,
client character(36) DEFAULT ''::bpchar NOT NULL,
client uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL,
client_sequence integer,
CONSTRAINT name_length CHECK ((length(TRIM(BOTH FROM name)) > 0))
);
@ -328,7 +328,7 @@ CREATE TABLE public.node (
CREATE TABLE public.node_history (
id integer NOT NULL,
user_id integer NOT NULL,
uuid character(36) NOT NULL,
"uuid" uuid NOT NULL,
parents character varying[],
created timestamp with time zone NOT NULL,
updated timestamp with time zone NOT NULL,
@ -336,7 +336,7 @@ CREATE TABLE public.node_history (
content text NOT NULL,
content_encrypted text NOT NULL,
markdown boolean DEFAULT false NOT NULL,
client character(36) DEFAULT ''::bpchar NOT NULL,
client uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL,
client_sequence integer
);