mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-04-26 14:27:24 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user