Add Operations section
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
WITH ranked AS (
|
||||
SELECT
|
||||
t.*,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY t.inventortools_drawingpath
|
||||
ORDER BY t.inventortools_build_date DESC, t.inventortools_id DESC
|
||||
) AS rn
|
||||
FROM mpe.inventortools t
|
||||
)
|
||||
SELECT
|
||||
r.inventortools_id AS "ID",
|
||||
CONCAT('http://magnafastapi:8000/api/v1/webfrontend/logs/itools/job/', r.inventortools_id) AS "URL",
|
||||
r.inventortools_drawingpath AS "Drawing Path",
|
||||
CONCAT(r.inventortools_svn_id, ' (', TO_CHAR(r.inventortools_build_date, 'YY-MM-DD HH24:MI'), ')') AS "SVN",
|
||||
r.inventortools_user AS "User",
|
||||
r.inventortools_message AS "Message",
|
||||
COALESCE(array_length(r.inventortools_unresolvedreferencepaths, 1), 0) AS "Unresolved Count",
|
||||
COALESCE(array_length(r.inventortools_unresolvedreferencepaths, 1), 0) > 0 AS "Has Unresolved",
|
||||
CASE
|
||||
WHEN COALESCE(array_length(r.inventortools_unresolvedreferencepaths, 1), 0) > 0 THEN
|
||||
array_to_string(
|
||||
ARRAY (
|
||||
SELECT CONCAT(
|
||||
split_part(regexp_replace(unres_path.path, E'\\','/','g'), '/', 1),
|
||||
'/.../',
|
||||
regexp_replace(regexp_replace(unres_path.path, E'\\','/','g'), '^.*/', '')
|
||||
)
|
||||
FROM unnest(r.inventortools_unresolvedreferencepaths) AS unres_path(path)
|
||||
),
|
||||
'; '
|
||||
)
|
||||
ELSE
|
||||
'No unresolved references'
|
||||
END AS "Unresolved Links"
|
||||
FROM ranked r
|
||||
WHERE r.rn = 1
|
||||
AND r.inventortools_message IS NOT NULL
|
||||
AND r.inventortools_message <> ''
|
||||
ORDER BY r.inventortools_id DESC
|
||||
Reference in New Issue
Block a user