TEST: field locking test fixes 7

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-01-29 10:17:45 +11:00
parent 7faaa630a1
commit 2086e78a39
2 changed files with 21 additions and 18 deletions

View File

@@ -89,6 +89,8 @@ def exclude_ignored_devices(db):
# -------------------------------------------------------------------------------
FIELD_SPECS = {
# ⚠ "priority" is unused currently ⚠
# ==========================================================
# DEVICE NAME
# ==========================================================
@@ -361,13 +363,13 @@ def update_ipv4_ipv6(db):
# We use COALESCE(?, Column) so that if the first arg is NULL,
# it keeps the current value of the column.
mylog("none", f"[Update Devices] Updated records_to_update: {records_to_update}")
# mylog("none", f"[Update Devices] Updated records_to_update: {records_to_update}")
sql.executemany(
"""
UPDATE Devices
SET devPrimaryIPv4 = COALESCE(?, NULLIF(devPrimaryIPv4, '')),
devPrimaryIPv6 = COALESCE(?, NULLIF(devPrimaryIPv6, ''))
SET devPrimaryIPv4 = COALESCE(NULLIF(?, ''), devPrimaryIPv4),
devPrimaryIPv6 = COALESCE(NULLIF(?, ''), devPrimaryIPv6)
WHERE devMac = ?
""",
records_to_update,