-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathGDrive_cloudgraph.sql
42 lines (41 loc) · 1.03 KB
/
GDrive_cloudgraph.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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