Files
OpsLog/internal/db/migrations/0001_init.sql
T
rouggy 7ace2cc602 Initial codebase: Go + Wails amateur radio logbook
Backend (Go 1.25 / Wails v2):
- QSO storage on SQLite (modernc) with embedded migrations (0001..0005)
- Streaming ADIF import (batch insert) + WorkedBefore per callsign and DXCC
- Callsign lookup with QRZ.com + HamQTH providers (primary/failsafe routing)
  and SQLite-backed TTL cache
- DXCC resolver from cty.dat (auto-download, longest-prefix-match)
- Multi-profile operator identities (home/portable/SOTA/contest) — every
  QSO stamps MY_* from the active profile
- CAT control via OmniRig COM on a single OS-locked goroutine, with
  bidirectional sync (freq/mode/band/split/VFOs) and Rig1/Rig2 hot-swap
- Settings store (key/value), CAT debug log at %APPDATA%/HamLog/cat.log

Frontend (React 18 + TypeScript + Tailwind v4 + shadcn-style):
- Single-row entry strip with CAT-aware band/mode/freq, RST, Start/End
  UTC, per-field locks (band/mode/freq/start/end) for backdated QSOs
- Topbar: live freq (MHz.kHz.Hz dotted), live UTC, band/mode/SPLIT badges,
  CAT pill with rig selector and clickable Azimuth pill (rotor TODO)
- Settings tree: Profiles (Log4OM-style manager), Station Information
  (edits the active profile), unified Callsign Lookup with Test buttons,
  Bands/Modes lists, CAT
- Worked-before matrix (band × mode × class) with new-DXCC highlighting
- ADIF import from menu + Maintenance > Refresh cty.dat

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 00:16:45 +02:00

51 lines
1.9 KiB
SQL

-- HamLog initial schema
-- QSO table: core of the logbook. Field names stay close to ADIF.
CREATE TABLE IF NOT EXISTS qso (
id INTEGER PRIMARY KEY AUTOINCREMENT,
callsign TEXT NOT NULL,
qso_date TEXT NOT NULL, -- ISO 8601 UTC: YYYY-MM-DDTHH:MM:SSZ
band TEXT NOT NULL, -- e.g. 20m, 40m, 2m
mode TEXT NOT NULL, -- e.g. SSB, CW, FT8
freq_hz INTEGER, -- frequency in Hz (integer, avoids floats)
rst_sent TEXT,
rst_rcvd TEXT,
name TEXT,
qth TEXT,
grid TEXT,
country TEXT,
dxcc INTEGER,
cont TEXT,
cqz INTEGER,
ituz INTEGER,
iota TEXT,
sota_ref TEXT,
pota_ref TEXT,
-- Operator context (multi-callsign / multi-location)
station_callsign TEXT,
operator TEXT,
my_grid TEXT,
my_country TEXT,
my_sota_ref TEXT,
my_pota_ref TEXT,
-- Misc
tx_pwr REAL,
comment TEXT,
notes TEXT,
qsl_sent TEXT DEFAULT 'N',
qsl_rcvd TEXT DEFAULT 'N',
lotw_sent TEXT DEFAULT 'N',
lotw_rcvd TEXT DEFAULT 'N',
eqsl_sent TEXT DEFAULT 'N',
eqsl_rcvd TEXT DEFAULT 'N',
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))
);
CREATE INDEX IF NOT EXISTS idx_qso_callsign ON qso(callsign);
CREATE INDEX IF NOT EXISTS idx_qso_date ON qso(qso_date DESC);
CREATE INDEX IF NOT EXISTS idx_qso_band_mode ON qso(band, mode);
CREATE INDEX IF NOT EXISTS idx_qso_dxcc ON qso(dxcc);
CREATE INDEX IF NOT EXISTS idx_qso_grid ON qso(grid);
CREATE INDEX IF NOT EXISTS idx_qso_station ON qso(station_callsign);