fix(nodes): persist show_port_numbers across reloads
The Show Port Numbers toggle reset on every reload because the backend never stored it: the column was missing from the Node model and the field was stripped by NodeSave/NodeBase/NodeUpdate schemas, so canvas/save silently dropped it. Add the show_port_numbers column (idempotent migration), and the field to the node schemas so it round-trips through save/load. Add regression tests covering persistence and the default-false case. Fixes #184 ha-relevant: yes
This commit is contained in:
@@ -91,6 +91,8 @@ async def init_db() -> None:
|
||||
await conn.exec_driver_sql("ALTER TABLE nodes ADD COLUMN disk_gb REAL")
|
||||
with suppress(OperationalError):
|
||||
await conn.exec_driver_sql("ALTER TABLE nodes ADD COLUMN show_hardware BOOLEAN NOT NULL DEFAULT 0")
|
||||
with suppress(OperationalError):
|
||||
await conn.exec_driver_sql("ALTER TABLE nodes ADD COLUMN show_port_numbers BOOLEAN NOT NULL DEFAULT 0")
|
||||
with suppress(OperationalError):
|
||||
await conn.exec_driver_sql("ALTER TABLE nodes ADD COLUMN width REAL")
|
||||
with suppress(OperationalError):
|
||||
|
||||
Reference in New Issue
Block a user