lppiece: Implement Piece Park

This commit is contained in:
Łukasz Magiera
2024-03-14 09:36:03 +01:00
parent 0b2613ec21
commit e060cd2f37
10 changed files with 326 additions and 19 deletions
@@ -0,0 +1,30 @@
create table parked_pieces (
id serial primary key,
created_at timestamp default current_timestamp,
piece_cid text not null,
piece_padded_size bigint not null,
piece_raw_size text not null,
complete boolean not null default false
);
create table parked_piece_refs (
ref_id serial primary key,
piece_id int not null,
foreign key (piece_id) references parked_pieces(id) on delete cascade
);
create table park_piece_tasks (
task_id bigint not null
constraint park_piece_tasks_pk
primary key,
piece_ref_id int not null,
data_url text not null,
data_headers jsonb not null default '{}',
data_raw_size bigint not null,
data_delete_on_finalize bool not null
);