Skip to content

Commit

Permalink
filter
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Apr 9, 2024
1 parent df48fba commit 3d3ce42
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src-admintool/queries/prune_files_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ def get_title
def get_sql
%{
select distinct
'urlparam' type,
o.ark,
o.version_number,
substring_index(f.pathname, '?', 1) norm,
lower(substring_index(substring_index(f.pathname, '?', 1), '.', -1)) ext,
max(v.number),
count(distinct f.pathname),
count(distinct digest_value)
count(distinct digest_value),
case
when lower(substring_index(substring_index(f.pathname, '?', 1), '.', -1)) in ('txt', 'json', 'xml')
then 'INFO'
else 'WARN'
end as status
from
inv.inv_objects o
inner join
Expand Down Expand Up @@ -53,13 +60,20 @@ def get_sql
count(distinct digest_value) > 1
union
select distinct
'deleted' type,
o.ark,
o.version_number,
substring_index(f.pathname, '?', 1) norm,
lower(substring_index(substring_index(f.pathname, '?', 1), '.', -1)) ext,
max(v.number),
count(distinct f.pathname),
count(distinct digest_value)
from
count(distinct digest_value),
case
when lower(substring_index(substring_index(f.pathname, '?', 1), '.', -1)) in ('txt', 'json', 'xml')
then 'INFO'
else 'WARN'
end as status
from
inv.inv_objects o
inner join
inv.inv_files f
Expand Down Expand Up @@ -98,10 +112,10 @@ def get_params
end

def get_headers(_results)
['Ark', 'Version', 'Path', 'Max Ver', 'Path Count', 'Digest Count']
['Type','Ark', 'Version', 'Path', 'Ext', 'Max Ver', 'Path Count', 'Digest Count', 'Status']
end

def get_types(_results)
['ark', '', 'name', '', '', '']
['', 'ark', 'data', 'name', '', 'data', 'data', 'data', 'status']
end
end

0 comments on commit 3d3ce42

Please sign in to comment.