fix: undefined err in packets_v view creation (use vErr)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Kpa-clawbot
2026-03-28 11:59:48 -07:00
parent 57b0188158
commit aba4270ceb

View File

@@ -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