Google Drive (desktop)

master
Costas K 5 years ago committed by GitHub
parent 30d3bb88f0
commit 7555dc681a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,42 @@
Select
case
when doc_id = 'root' then 'root'
when parent_doc_id = 'root' then 'root'
else (select filename from cloud_graph_entry where parent_doc_id = doc_id)
end as Parent,
Filename,
size,
checksum as MD5,
case doc_type
when 0 then 'Folder'
when 1 then 'File'
when 4 then 'Google Spreadsheet'
when 6 then 'Google Document'
when 12 then 'Google My Maps'
else doc_type
end as doc_type,
case shared
when 0 then ''
when 1 then 'Yes'
end as shared,
datetime(modified,'unixepoch','localtime') as modified,
version,
case acl_role
when 2 then 'Can View'
when 1 then 'Can Contribute'
when 0 then 'Private'
else acl_role
end as acl_role,
case download_restricted
when 0 then ''
when 1 then 'Yes'
else download_restricted
end as download_restricted,
photos_storage_policy,
down_sample_status,
doc_id,
cloud_relations.parent_doc_id
From cloud_graph_entry
left join cloud_relations on cloud_graph_entry.doc_id = cloud_relations.child_doc_id
order by modified desc

@ -1,55 +1,62 @@
select select
mapping.doc_id as 'Doc_ID', case cloud_entry.acl_role
case cloud_entry.doc_type when 2 then 'Can View'
when 0 then 'Folder' when 1 then 'Can Contribute'
when 1 then 'File' when 0 then 'Private'
when 4 then 'Google Sheet' else cloud_entry.acl_role
else cloud_entry.doc_type end as acl_role,
end as 'Doc_Type', case cloud_entry.doc_type
cloud_entry.filename as 'Cloud_Filename', when 0 then 'Folder'
cloud_entry.checksum as 'Cloud_MD5_Hash', when 1 then 'File'
datetime(cloud_entry.modified, 'unixepoch','localtime') as 'Cloud_Modified', when 4 then 'Google Spreadsheet'
cloud_entry.size as 'Cloud_Size', when 6 then 'Google Document'
cloud_entry.original_size as 'Original Size', when 12 then 'Google My Maps'
case local_entry.is_folder else cloud_entry.doc_type
when 0 then 'No' end as doc_type,
when 1 then 'Yes' (select filename from cloud_entry where cloud_entry.doc_id = cloud_relations.parent_doc_id) as 'CloudParent',
end as 'Is_Folder', cloud_entry.filename as 'Cloud_Filename',
case cloud_entry.removed cloud_entry.checksum as 'Cloud_MD5_Hash',
when 0 then 'No' datetime(cloud_entry.modified, 'unixepoch','localtime') as 'Cloud_Modified',
when 1 then 'Yes' cloud_entry.size as 'Cloud_Size',
end as 'Removed' , cloud_entry.original_size as 'Original Size',
case cloud_entry.shared case cloud_entry.removed
when 0 then 'No' when 0 then 'No'
when 1 then 'Yes' when 1 then 'Yes'
end as 'Shared', end as 'Removed' ,
local_entry.filename as 'Local_Filename', case cloud_entry.shared
local_entry.size as 'Local_Size', when 0 then 'No'
local_entry.checksum as 'Local_MD5_Hash', when 1 then 'Yes'
datetime(local_entry.modified, 'unixepoch','localtime') as 'Local_Modified', end as 'Shared',
case case local_entry.is_folder
when local_entry.volume = volume_info.volume when 0 then 'No'
then volume_info.full_path||" - "||volume_info.device_type||" - Volume Name: ("||volume_info.label||")" when 1 then 'Yes'
else local_entry.volume end as 'Is_Folder',
end as 'Volume', (select filename from local_entry where local_entry.inode = local_relations.parent_inode) as 'LocalParent',
case local_entry.filename as 'Local_Filename',
when cloud_entry.checksum = local_entry.checksum local_entry.size as 'Local_Size',
then 'MD5 Match' local_entry.checksum as 'Local_MD5_Hash',
else (case datetime(local_entry.modified, 'unixepoch','localtime') as 'Local_Modified',
when cloud_entry.checksum notnull case
then 'No_Match' when cloud_entry.checksum = local_entry.checksum
else '' then 'MD5 Match'
end) else (case
end as 'MD5_Check', when cloud_entry.checksum notnull
case then 'No_Match'
when cloud_entry.modified = local_entry.modified else ''
then 'Dates Match' end)
else 'No Match' end as 'MD5_Check',
end as 'Cloud/Local_Dates Check', case
local_relations.child_volume as 'Child_Volume', when cloud_entry.modified = local_entry.modified
local_relations.parent_volume as 'Parent_Volume' then 'Dates Match'
else 'No Match'
end as 'Cloud/Local_Dates Check',
case
when local_entry.volume = volume_info.volume
then volume_info.full_path||" - "||volume_info.device_type||" - Volume Name: ("||volume_info.label||")"
else local_entry.volume
end as 'Volume',
local_relations.child_volume as 'Child_Volume',
local_relations.parent_volume as 'Parent_Volume'
from cloud_entry from cloud_entry
join mapping on cloud_entry.doc_id = mapping.doc_id join mapping on cloud_entry.doc_id = mapping.doc_id
@ -57,4 +64,4 @@ join cloud_relations on cloud_entry.doc_id = cloud_relations.child_doc_id
join local_entry on local_entry.inode = mapping.inode join local_entry on local_entry.inode = mapping.inode
join local_relations on local_relations.child_inode = local_entry.inode join local_relations on local_relations.child_inode = local_entry.inode
left join volume_info on volume_info.volume = local_entry.volume left join volume_info on volume_info.volume = local_entry.volume
order by Local_Modified desc --order by Local_Modified desc
Loading…
Cancel
Save