X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_ASA_SearchUpdate;h=d8600370d55b2605bf4438fb5ebce2af1ebb0e1b;hp=929e848dc85e76543c7f8bba20727ae77e37ecb7;hb=5da6f2d3b119993d9def86b5481a86ce6fd84059;hpb=06017d5181d9c62f8cbd1c6d58d831f54d7d4ad1;ds=sidebyside diff --git a/bin/BackupPC_ASA_SearchUpdate b/bin/BackupPC_ASA_SearchUpdate index 929e848..d860037 100755 --- a/bin/BackupPC_ASA_SearchUpdate +++ b/bin/BackupPC_ASA_SearchUpdate @@ -740,10 +740,20 @@ JOIN archive ON archive_id = archive.id JOIN backups ON backup_id = backups.id JOIN hosts ON hostid = hosts.id JOIN shares ON shareid = shares.id -ORDER BY backup_id, part_nr ; +CREATE VIEW backups_burned AS +SELECT + backup_id, + count(backup_id) = count(backup_part_id) as burned +FROM archive +JOIN archive_parts ON archive.id = archive_id +JOIN backup_parts ON backup_part_id = backup_id +GROUP BY backup_id +; + +-- triggers for backup_parts consistency create or replace function backup_parts_check() returns trigger as ' declare b_parts integer;