diff --git a/scripts/migrate_messages.py b/scripts/migrate_messages.py index 15cc357..c1da9f8 100644 --- a/scripts/migrate_messages.py +++ b/scripts/migrate_messages.py @@ -27,7 +27,7 @@ from database import (SessionLocal, PrivateMessage, MessageGroup, MessageGroupMe def build_content(subject, content): """Prepend subject as bold line if present.""" if subject and subject.strip(): - return f"**{subject.strip()}**\n\n{content}" + return f"

{subject.strip()}

{content}" return content @@ -95,16 +95,15 @@ def migrate_private_messages(db, dry_run): for pm in pair_msgs: full_content = build_content(pm.subject, pm.content) - # Resolve reply_to_id from old parent_id - reply_to_id = None - if pm.parent_id and pm.parent_id in pm_id_map: - reply_to_id = pm_id_map[pm.parent_id] + # Note: old parent_id was thread-root (email-style), not a specific quote. + # Don't map to reply_to_id — it would create visual clutter with every + # reply quoting the same root message. conv_msg = ConvMessage( conversation_id=conv.id, sender_id=pm.sender_id, content=full_content, - reply_to_id=reply_to_id, + reply_to_id=None, created_at=pm.created_at, ) db.add(conv_msg)