Files
nettopo-go/internal/store/sql/003_scan_port_devices.sql
T
2026-04-13 12:04:35 +10:00

17 lines
522 B
SQL

create table if not exists scan_port_devices (
id bigserial primary key,
scan_id text not null references scan_jobs(id) on delete cascade,
ip inet not null,
if_index int not null,
bridge_port int not null default 0,
mac text not null,
learned_ip inet null,
checked_at timestamptz not null
);
create index if not exists idx_scan_port_devices_scan_ip_if
on scan_port_devices (scan_id, ip, if_index);
create index if not exists idx_scan_port_devices_scan_ip_mac
on scan_port_devices (scan_id, ip, mac);