You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Laravel 10, Laravel generates sortable UUIDs, but it looks like this packages still uses v4, which is completely random.
I ran into an issue where I wanted to sort log entries by create time - but the entries were created at the exact same second, so some entries that actually happened earlier were sorted as occurring later.
I though if the batch_uuid would be sortable, then perhaps that would help.
I ran a small test, by simply changing the generated uuid from v4 to v7 in LogBatch, and indeed sorting first by created_ad DESC and then batch_uuid DESC yields correct results, even if the create_at timestamps are the same.
Is there any reason not to use uuid v7, or perhaps make it possible to use a custom UUID generator?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Since Laravel 10, Laravel generates sortable UUIDs, but it looks like this packages still uses v4, which is completely random.
I ran into an issue where I wanted to sort log entries by create time - but the entries were created at the exact same second, so some entries that actually happened earlier were sorted as occurring later.
I though if the
batch_uuid
would be sortable, then perhaps that would help.I ran a small test, by simply changing the generated uuid from v4 to v7 in
LogBatch
, and indeed sorting first by created_ad DESC and then batch_uuid DESC yields correct results, even if the create_at timestamps are the same.Is there any reason not to use uuid v7, or perhaps make it possible to use a custom UUID generator?
Beta Was this translation helpful? Give feedback.
All reactions