Skip to content

Commit

Permalink
Add metadata to tag definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
lwjameson committed Oct 24, 2024
1 parent 4f594ba commit 7076a2c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SQL Scripts/tables/tag_definitions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ CREATE TABLE tag_definitions
name varchar NOT NULL,
target_type tag_target_types NOT NULL,
scope tag_scope_types NOT NULL,
scope_id uuid
scope_id uuid,
metadata json NOT NULL DEFAULT {}
);

-- Changes 05/26/23 --
Expand All @@ -26,3 +27,7 @@ ALTER TABLE public.tag_definitions
-- Changes 7/26/23 --
ALTER TABLE public.tag_definitions
ADD COLUMN is_archived bool DEFAULT FALSE;

-- Changes 10/24/24
ALTER TABLE public.tag_definitions
ADD COLUMN metadata json NOT NULL DEFAULT '{}';
11 changes: 11 additions & 0 deletions SQL Scripts/utility/add_read_only_groups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DECLARE
_is_default bool;
_is_read_only bool;
_layer_id uuid;
_project_id uuid;
BEGIN
-- Get the read-only default group
FOR _role_id, _name, _description, _is_admin, _is_default, _is_read_only
Expand All @@ -27,5 +28,15 @@ BEGIN
END IF;
END LOOP;
END LOOP;
-- Set the Student role in project groups to read-only
FOR _project_id
IN SELECT p.id
FROM public.projects p
LOOP
-- For each project group set the Student role to read-only
UPDATE public.project_groups pg
SET is_read_only = TRUE
WHERE pg.is_default IS TRUE;
END LOOP;
END
$$
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
alter table "public"."tag_definitions" add column "metadata" json not null default '{}'::json;


0 comments on commit 7076a2c

Please sign in to comment.