feat(ui,snmp): IF-MIB интерфейсы в табл.1 связей, слияние с LLDP, сортировка по локальному порту

Made-with: Cursor
This commit is contained in:
Луценко Андрей Анатольевич
2026-04-10 16:04:16 +10:00
parent 2388b5f3ff
commit a7f80eac9a
7 changed files with 448 additions and 40 deletions
+10 -2
View File
@@ -8,7 +8,15 @@ import (
//go:embed sql/001_init.sql
var initSQL string
//go:embed sql/002_scan_interfaces.sql
var scanInterfacesSQL string
func RunMigrations(db *sql.DB) error {
_, err := db.Exec(initSQL)
return err
if _, err := db.Exec(initSQL); err != nil {
return err
}
if _, err := db.Exec(scanInterfacesSQL); err != nil {
return err
}
return nil
}
@@ -0,0 +1,13 @@
create table if not exists scan_interfaces (
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,
if_descr text null,
if_name text null,
if_oper_status text null,
checked_at timestamptz not null
);
create index if not exists idx_scan_interfaces_scan_ip_idx
on scan_interfaces (scan_id, ip, if_index);