Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Activity Report SQL Fix #2

Merged
merged 2 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions container/oracle/initd.d/02_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ with component_activity as (
where revtype = 1 and masked <> previous_masked
),
category_activity as (
select rev, revtstmp, username, category_id, 'CATEGORY: ' || (select name from srm_owner.all_categories where category_id = srm_owner.category_aud.category_id) as remark, case revtype when 0 then 'ADD_CATEGORY' else 'DELETE_CATEGORY' end as change_type from srm_owner.application_revision_info inner join srm_owner.category_aud using(rev) where revtype in (0,2)
select rev, revtstmp, username, category_id, 'CATEGORY: ' || name as remark, case revtype when 0 then 'ADD_CATEGORY' else 'DELETE_CATEGORY' end as change_type from srm_owner.application_revision_info inner join srm_owner.category_aud using(rev) where revtype in (0,2)
union all
select rev, revtstmp, username, category_id, (select name from srm_owner.all_categories where category_id = previous_parent_id) || ' --> ' || (select name from srm_owner.all_categories where category_id = par_cat.parent_id) as remark, 'REORGANIZE_CATEGORY' as change_type from
(select revtype, rev, revtstmp, username, category_id, parent_id, lag(parent_id) over (partition by category_id order by rev) as previous_parent_id from srm_owner.application_revision_info inner join srm_owner.category_aud using(rev)) par_cat
Expand All @@ -619,7 +619,7 @@ with component_activity as (
where revtype = 1 and name <> previous_name
),
system_activity as (
select rev, revtstmp, username, category_id, system_id, 'CATEGORY: ' || (select name from srm_owner.all_categories where category_id = system_aud.category_id) as remark, case revtype when 0 then 'ADD_SYSTEM' else 'DELETE_SYSTEM' end as change_type from srm_owner.application_revision_info inner join srm_owner.system_aud using(rev) where revtype in (0,2)
select rev, revtstmp, username, category_id, system_id, 'CATEGORY: ' || (select name from srm_owner.all_categories where category_id = system_aud.category_id and rownum = 1) as remark, case revtype when 0 then 'ADD_SYSTEM' else 'DELETE_SYSTEM' end as change_type from srm_owner.application_revision_info inner join srm_owner.system_aud using(rev) where revtype in (0,2)
union all
select rev, revtstmp, username, category_id, system_id, (select name from srm_owner.all_categories where category_id = previous_category_id) || ' --> ' || (select name from srm_owner.all_categories where category_id = cat_sub.category_id) as remark, 'REORGANIZE_SYSTEM' as change_type from
(select revtype, rev, revtstmp, username, category_id, system_id, lag(category_id) over (partition by system_id order by rev) as previous_category_id from srm_owner.application_revision_info inner join srm_owner.system_aud using(rev)) cat_sub
Expand Down