Files
OpsLog/internal/db/migrations/0012_fix_rig_ant_fields.sql
T
2026-05-28 21:32:46 +02:00

20 lines
766 B
SQL

-- The UDP auto-log path was filling the non-standard `rig` and `ant`
-- columns (intended for the contacted station's rig/antenna, rarely
-- used) instead of `my_rig` / `my_antenna` (the official ADIF MY_RIG /
-- MY_ANTENNA fields). Move any data that's already there to the right
-- column when the standard one is empty — then clear the non-standard
-- fields so the QSOs match what should have been logged.
UPDATE qso
SET my_rig = rig
WHERE (my_rig IS NULL OR my_rig = '')
AND rig IS NOT NULL AND rig != '';
UPDATE qso
SET my_antenna = ant
WHERE (my_antenna IS NULL OR my_antenna = '')
AND ant IS NOT NULL AND ant != '';
UPDATE qso SET rig = '' WHERE rig IS NOT NULL AND rig != '';
UPDATE qso SET ant = '' WHERE ant IS NOT NULL AND ant != '';