Skip to content
Snippets Groups Projects
Commit 74fd0219 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added unique path constraint

parent 57b0f3f8
No related branches found
No related tags found
No related merge requests found
Pipeline #1915 passed
......@@ -36,5 +36,7 @@ CREATE UNIQUE INDEX file_path_idx ON node USING btree(path);
ALTER TABLE node ADD COLUMN relative_path ltree GENERATED ALWAYS AS (path(parent_relative_path, node_id)) STORED;
CREATE INDEX file_rel_path_gist_idx ON node USING GIST(relative_path);
ALTER TABLE node ADD CONSTRAINT unique_path UNIQUE (parent_path, name);
-- Create root node
INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, is_public) VALUES (NULL, NULL, '', 'container', '0', true);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment