mirror of
https://github.com/ddworken/hishtory.git
synced 2025-07-01 13:11:22 +02:00
Add initial code to support unique per-entry IDs
This code has two caveats for old entries: 1. the ID is being backfiled with a random per-(device,entry) ID. So the ID won't match cross-device. 2. the server-side ID will still be a random ID that is unrelated to the entry ID
This commit is contained in:
@ -303,6 +303,7 @@ func ImportHistory(ctx context.Context, shouldReadStdin, force bool) (int, error
|
||||
StartTime: time.Now().UTC(),
|
||||
EndTime: time.Now().UTC(),
|
||||
DeviceId: config.DeviceId,
|
||||
EntryId: uuid.Must(uuid.NewRandom()).String(),
|
||||
}
|
||||
err = ReliableDbCreate(db, entry)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user