From aba4270ceb4be2bb3186102b2e30140f4e975057 Mon Sep 17 00:00:00 2001 From: Kpa-clawbot <259247574+Kpa-clawbot@users.noreply.github.com> Date: Sat, 28 Mar 2026 11:59:48 -0700 Subject: [PATCH] fix: undefined err in packets_v view creation (use vErr) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cmd/ingestor/db.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/ingestor/db.go b/cmd/ingestor/db.go index 449a286..3a86f1b 100644 --- a/cmd/ingestor/db.go +++ b/cmd/ingestor/db.go @@ -170,7 +170,7 @@ func applySchema(db *sql.DB) error { // Create/rebuild packets_v view (v3 schema: observer_idx → observers.rowid) // The Go server reads this view; without it fresh installs get "no such table: packets_v". db.Exec(`DROP VIEW IF EXISTS packets_v`) - _, err = db.Exec(` + _, vErr := db.Exec(` CREATE VIEW packets_v AS SELECT o.id, t.raw_hex, datetime(o.timestamp, 'unixepoch') AS timestamp, @@ -182,8 +182,8 @@ func applySchema(db *sql.DB) error { JOIN transmissions t ON t.id = o.transmission_id LEFT JOIN observers obs ON obs.rowid = o.observer_idx `) - if err != nil { - return fmt.Errorf("packets_v view: %w", err) + if vErr != nil { + return fmt.Errorf("packets_v view: %w", vErr) } // One-time migration: recalculate advert_count to count unique transmissions only