Laravel-activitylog: Change primary key to use uuid

Created on 13 Feb 2020  路  5Comments  路  Source: spatie/laravel-activitylog

I have diferents logs, and legacy tables. I need merge, and I will generate log offline.
How can I change the primary key.

question stale

Most helpful comment

Hey,
you will have to override the model, register your new one in the config and update the migration.
After this your activities will get a uuid instead of an autoincrement.

All 5 comments

Hey,
you will have to override the model, register your new one in the config and update the migration.
After this your activities will get a uuid instead of an autoincrement.

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days

Do you intend to develop something to facilitate this in the future, something configurable?

Because there is a simple to implement solution we won't add any uses_uuid or similar config value.
If there's any code part in the package that assumes that the ID is an int we will try to fix this to make this change easier. But none of the spatie packages provides UUID primary key support out of the box.
That's why we publish the migration and allow to override the model.

Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lucianobosco picture lucianobosco  路  5Comments

TheFrankman picture TheFrankman  路  5Comments

BerendSpigt picture BerendSpigt  路  4Comments

lflucasferreira picture lflucasferreira  路  3Comments

Hesesses picture Hesesses  路  5Comments