X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=db.sql;h=316f3e47ba42354640d334341d0771bafd12f0aa;hb=ec7880f0b240eee1f829a23cdecb4bef75644eb6;hp=427c1ef4d586a3c6e26ca8871749e573a7732684;hpb=a822809a00abd6388959e601b9b6b1572481e4bc;p=zpackage diff --git a/db.sql b/db.sql index 427c1ef..316f3e4 100644 --- a/db.sql +++ b/db.sql @@ -16,11 +16,13 @@ CREATE TABLE files ( ; create view filerefs as -select F.hash, count(PF.hash) + count(S.hash) + count(EL.file) as refcount +select F.hash, +count(PF.hash) + count(S.hash) + count(EL.file) + count(N.file) as refcount from files F left join packagefiles PF on PF.hash = F.hash left join scripts S on S.hash = F.hash left join elflibraries EL on EL.file = F.hash +left join notes N on N.file = F.hash group by F.hash ; @@ -475,7 +477,10 @@ modified as ( select distinct SS.path, SS.username, SS.uid, SS.groupname, SS.gid, SS.mode, SS.filetype, - SS.mtime, SS.hash, SS.configuration, SS.target, SS.device, + SS.mtime, SS.hash, + SS.configuration + case when OS.configuration = 1 then 2 else 0 end + as configuration, + SS.target, SS.device, OS.hash as ohash, SS.mds, OS.mds as omds from syncstatus SS join syncstatus OS