ALTER TABLE public.node ADD parent_node_id int4 DEFAULT 0 NULL;

UPDATE node
SET parent_node_id = (
	SELECT parent FROM connection WHERE child = id
) WHERE id > 0;
