Replies: 1 comment
-
Since we have the Batch-UUIDs we generate them for every activity. So I would recommend you a migration that generates a UUID for every activity without a Batch-UUID and after that you don't have to use This should do it. DB::connection(config('activitylog.database_connection'))
->table(config('activitylog.table_name'))
->whereNull('batch_uuid')
->get()
->each(fn(Activity $activity) => $activity->update(['batch_uuid' => Str::uuid()])); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello !
Thanks for this great package !
How can we select all activities (paginated) but with distinct batch_uuid, so we get only the first activity of a batch (order by id) instead of all activities with the same batch_uuid ? (I am using Postgres)
I have try
distinct on (coalesce(batch_uuid,uuid_generate_v4())) *
but this is very slow when there is a lot of entries.My Ids are bigint so I cannot do this
distinct on (coalesce(batch_uuid,id)) *
(not the same type)Beta Was this translation helpful? Give feedback.
All reactions