Skip to main content

Function: repairUserTextMarkup()

repairUserTextMarkup(db): UserSchemaRepairReport

Defined in: Data/Migration/repairUserSchema.ts:110

Bring user_text_markup up to the current shape if an older build created it.

Two drifts are detected and fixed together, because both require the same table rebuild and doing them in one pass halves the risk:

  1. The v1 colour CHECK (pre Module Format v2). Rejects every hex colour the app writes — this is what broke highlight and underline outright.
  2. A nullable verse_id_end (pre R-1). A NULL end made a single-verse markup match every range query starting after it, which mis-selected in getForVerseRange and silently deleted out-of-range markups in deleteForVerseRange.

Safe to call on every open; returns immediately when the table is already current or does not exist.

Parameters

db

ISql

Returns

UserSchemaRepairReport