Skip to content

Commit

Permalink
Include the imported column on the reporting annotations table
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospri committed Sep 5, 2023
1 parent a4de41d commit 0ac0038
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ CREATE TABLE report.annotations (
anchored BOOLEAN NOT NULL,
size INT,
parent_uuids UUID[],
tags TEXT[]
tags TEXT[],
imported BOOLEAN NOT NULL
);
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INSERT INTO report.annotations (
user_id, group_id, document_id, authority_id,
created, updated,
deleted, shared, anchored, size,
parent_uuids, tags
parent_uuids, tags, imported
)
SELECT
annotation.id as uuid,
Expand All @@ -29,7 +29,8 @@ SELECT
JSONB_ARRAY_LENGTH(target_selectors) <> 0 AS anchored,
LENGTH(text) AS size,
"references",
tags
tags,
coalesce(extra ->'extra'->>'source' = 'import', false)
FROM annotation
JOIN "user" users ON
users.authority = SPLIT_PART(annotation.userid, '@', 2)
Expand Down
5 changes: 3 additions & 2 deletions h/data_tasks/report/refresh/01_annotations_refresh.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ INSERT INTO report.annotations (
user_id, group_id, document_id, authority_id,
created, updated,
deleted, shared, anchored, size,
parent_uuids, tags
parent_uuids, tags, imported
)
SELECT
annotation.id as uuid,
Expand All @@ -33,7 +33,8 @@ SELECT
JSONB_ARRAY_LENGTH(target_selectors) <> 0 AS anchored,
LENGTH(text) AS size,
"references",
tags
tags,
coalesce(extra ->'extra'->>'source' = 'import', false)
FROM annotation
JOIN "user" users ON
users.authority = SPLIT_PART(annotation.userid, '@', 2)
Expand Down

0 comments on commit 0ac0038

Please sign in to comment.