╭ changed ───────────────╮ │src/event/Attachment.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │13 event: Self, │ │14 removed: bool = false, │ │15 author_email: ?[]const u8 = null, │ │16 - created_ts: u64 = 0, // the commit timestamp of the event that created this attachment│ │16 + created_order: u64 = 0, │ │17 name: []const u8, │ │18 blob_oid: []const u8, │ │19 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │ 94 if (existing_record_maybe) |existing_record| { │ │ 95 // the file never changes, so an update preserves everything the original│ │ 96 // commit determined │ │ 97 - record_to_write.created_ts = existing_record.created_ts; │ │ 97 + record_to_write.created_order = existing_record.created_order; │ │ 98 record_to_write.author_email = existing_record.author_email; │ │ 99 record_to_write.name = existing_record.name; │ │100 record_to_write.blob_oid = existing_record.blob_oid; │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │106 const attachment_cursor = try event_id_to_attachment.putCursor(attachment_key); │ │107 const attachment = try DB.HashMap(.read_write).init(attachment_cursor); │ │108 try evt.upsert(Record, DB, hash_kind, attachment, record_to_write); │ │109 - try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .attach, record_to_write.created_ts, record_to_write.removed); │ │109 + try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .attach, record_to_write.created_order, record_to_write.removed);│ │110 │ │111 if (existing_cursor_maybe == null) { │ │112 const attachment_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key)); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │113 const attachment_id_set = try DB.SortedSet(.read_write).init(attachment_id_set_cursor);│ │114 - try attachment_id_set.put(&evt.orderKeyDesc(record_to_write.created_ts, event_id)); │ │114 + try attachment_id_set.put(&evt.orderKeyDesc(record_to_write.created_order, event_id)); │ │115 } │ │116 │ │117 // removed attachments stay in the parent's set; the views skip them │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │118 const parent_attachments_cursor = try parent_id_to_attachment_id_set.putCursor(hash.hashInt(hash_kind, &record_to_write.event.parent_id));│ │119 const parent_attachments = try DB.SortedSet(.read_write).init(parent_attachments_cursor); │ │120 - try parent_attachments.put(&evt.orderKey(record_to_write.created_ts, event_id)); │ │120 + try parent_attachments.put(&evt.orderKey(record_to_write.created_order, event_id)); │ │121 } │ │122 │ │123 // attach `blob` to a parent event and return the event id. `repo` must be │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯