1 |
dpavlin |
235 |
drop table backup_parts; |
2 |
|
|
|
3 |
|
|
create table backup_parts ( |
4 |
|
|
id serial, |
5 |
|
|
backup_id int references backups(id), |
6 |
|
|
part_nr int not null check (part_nr > 0), |
7 |
|
|
tar_size bigint not null check (tar_size > 0), |
8 |
|
|
size bigint not null check (size > 0), |
9 |
|
|
md5 text not null, |
10 |
|
|
items int not null check (items > 0), |
11 |
|
|
date timestamp default now(), |
12 |
|
|
primary key(id) |
13 |
|
|
); |
14 |
|
|
|
15 |
|
|
-- ensure that backup part has unique numbers |
16 |
|
|
create unique index backup_part_nr on backup_parts(backup_id,part_nr); |
17 |
|
|
|