Context
During a DB nuke and reimport (2026-03-21), the reimport script did not populate the raw_id column on memories. This caused recall_project to crash with:
sql: Scan error on column index 1, name "raw_id": converting NULL to string is unsupported
122 out of 124 reimported memories had NULL raw_id. Fixed manually with UPDATE memories SET raw_id = id WHERE raw_id IS NULL.
Root cause
The export/reimport SQL didn't include raw_id in the INSERT statement. The column has no DEFAULT and no NOT NULL constraint, so SQLite silently accepted NULLs.
Fix
- Ensure backup export includes
raw_id in the column list
- Ensure reimport populates
raw_id (use id as fallback if not present in source data)
- Consider adding
NOT NULL DEFAULT '' or a CHECK constraint to prevent silent NULLs in the future
- Add a post-reimport validation step that checks for NULL required fields
Context
During a DB nuke and reimport (2026-03-21), the reimport script did not populate the
raw_idcolumn on memories. This causedrecall_projectto crash with:122 out of 124 reimported memories had NULL
raw_id. Fixed manually withUPDATE memories SET raw_id = id WHERE raw_id IS NULL.Root cause
The export/reimport SQL didn't include
raw_idin the INSERT statement. The column has no DEFAULT and no NOT NULL constraint, so SQLite silently accepted NULLs.Fix
raw_idin the column listraw_id(useidas fallback if not present in source data)NOT NULL DEFAULT ''or a CHECK constraint to prevent silent NULLs in the future