Persist per-host scan results and expose hosts endpoint.
Store checked hosts for each scan and add API to fetch host-level up/down probe results. Made-with: Cursor
This commit is contained in:
@@ -17,3 +17,14 @@ create index if not exists idx_scan_jobs_created_at on scan_jobs (created_at des
|
||||
|
||||
alter table scan_jobs add column if not exists progress int not null default 0;
|
||||
alter table scan_jobs add column if not exists stats jsonb not null default '{}'::jsonb;
|
||||
|
||||
create table if not exists scan_hosts (
|
||||
id bigserial primary key,
|
||||
scan_id text not null references scan_jobs(id) on delete cascade,
|
||||
ip inet not null,
|
||||
is_up boolean not null,
|
||||
checked_at timestamptz not null
|
||||
);
|
||||
|
||||
create index if not exists idx_scan_hosts_scan_id_checked_at
|
||||
on scan_hosts (scan_id, checked_at desc);
|
||||
|
||||
Reference in New Issue
Block a user