Functions
Populates Packet.messageText for historical text packets that predate the FTS5 schema (v39) so they become searchable. The text is decoded in Kotlin from each packet's DataPacket.text; it cannot be read with a SQL json_extract(data, '$.text') because DataPacket.text is a computed property that is never serialized into the stored JSON (the payload is persisted as bytes). Returns the number of rows updated; the caller rebuilds the FTS index via rebuildFtsIndex when this is greater than zero.
Insert a packet copied from another DB. Pass uuid = 0 so a fresh auto-generated id is assigned.
One-time migration: Remap all message DataPacket.channel indices to new mapping using PSK after a channel reorder. For each Packet (with port_num = 1), finds the old PSK then sets the channel index to the matching newSettings index. Skips if PSKs do not match or are missing.
Persists an on-device translation and switches the message to display it in one write.