╭ changed ───────────────╮ │src/event/Attachment.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────╮ │14 removed: bool = false, │ │15 author_email: ?[]const u8 = null,│ │16 created_order: u64 = 0, │ │17 + updated_order: u64 = 0, │ │18 name: []const u8, │ │19 blob_oid: []const u8, │ │20 }; │ ╰─────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │77 existing_record_maybe = try evt.read(Record, DB, hash_kind, arena, existing_attachment); │ │78 } │ │79 │ │79 - var record_to_write = if (record_maybe) |record| │ │80 - record │ │81 - else blk: { │ │82 - var record = existing_record_maybe orelse return error.EventNotFound; │ │83 - record.removed = true; │ │84 - break :blk record; │ │85 - }; │ │80 + var record_to_write = record_maybe orelse try evt.removedRecord(Record, DB, hash_kind, haxy_moment.readOnly(), existing_record_maybe);│ │81 │ │82 const id_bytes = try evt.parseEventId(&record_to_write.event.parent_id); │ │83 if (!try parentExists(DB, hash_kind, haxy_moment, &id_bytes)) return error.ParentNotFound; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 98 const attachment_cursor = try event_id_to_attachment.putCursor(attachment_key); │ │ 99 const attachment = try DB.HashMap(.read_write).init(attachment_cursor); │ │100 try evt.upsert(Record, DB, hash_kind, attachment, record_to_write); │ │106 - try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .attach, record_to_write.created_order, record_to_write.removed);│ │101 + try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .attach, existing_record_maybe, record_to_write); │ │102 │ │103 if (existing_cursor_maybe == null) { │ │104 const attachment_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key)); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯