feat: VLAN in FDB, persist vlan, enrich port-devices with hostname, UI columns

Made-with: Cursor
This commit is contained in:
PTah
2026-04-13 12:38:05 +10:00
parent 927110167c
commit 886300b6c0
8 changed files with 91 additions and 26 deletions
+6
View File
@@ -17,6 +17,9 @@ var scanPortDevicesSQL string
//go:embed sql/004_scan_port_devices_bridge_port.sql
var scanPortDevicesBridgePortSQL string
//go:embed sql/005_scan_port_devices_vlan.sql
var scanPortDevicesVlanSQL string
func RunMigrations(db *sql.DB) error {
if _, err := db.Exec(initSQL); err != nil {
return err
@@ -30,5 +33,8 @@ func RunMigrations(db *sql.DB) error {
if _, err := db.Exec(scanPortDevicesBridgePortSQL); err != nil {
return err
}
if _, err := db.Exec(scanPortDevicesVlanSQL); err != nil {
return err
}
return nil
}
@@ -4,6 +4,7 @@ create table if not exists scan_port_devices (
ip inet not null,
if_index int not null,
bridge_port int not null default 0,
vlan int not null default 0,
mac text not null,
learned_ip inet null,
checked_at timestamptz not null
@@ -0,0 +1 @@
alter table scan_port_devices add column if not exists vlan int not null default 0;