/[BackupPC]/trunk/sql/zz_fix_empty_backups.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/sql/zz_fix_empty_backups.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 367 - (show annotations)
Thu Jan 25 09:27:20 2007 UTC (17 years, 4 months ago) by dpavlin
File size: 600 byte(s)
fix empty backups

1 begin;
2
3 -- make temporary table with all backup ids
4 select backups.id into temporary all_backup_ids from files
5 join shares on files.shareid = shares.id
6 join backups on backups.hostid = shares.hostid and backups.num = files.backupnum
7 where files.shareid = shares.id
8 group by backups.id, files.shareid, files.backupnum
9 ;
10
11 -- fix backups which are deleted and have size anyway
12 update backups set inc_deleted = false where id not in (select id from all_backup_ids) and size > 0 ;
13
14 -- fix parts numbering
15
16 update backups set parts = 0 where parts > 0 and id not in (select backup_id from backup_parts) ;

  ViewVC Help
Powered by ViewVC 1.1.26