Skip to main content

migrate_conduit_highlight_split

Function migrate_conduit_highlight_split 

Source
pub(super) async fn migrate_conduit_highlight_split(
    services: &Services,
) -> Result
Expand description

Splits Conduit’s conflated highlight-count column. Conduit opens roomuserid_lastnotificationread against the userroomid_highlightcount tree (a copy-paste in its schema), so one column holds both stores: highlight counts keyed user_id 0xff room_id and last-notification-read tokens keyed room_id 0xff user_id. tuwunel keeps the two in separate columns with those same byte layouts, so every room-keyed (last-read) row moves verbatim into roomuserid_lastnotificationread, leaving the user-keyed highlight rows in place. The orderings never collide: a user id leads with @, a room id with !. Absent any room-keyed row the column is not aliased, so this returns early and is safe to run on a native database.