-
Notifications
You must be signed in to change notification settings - Fork 402
Closed
Description
| Q | A |
|---|---|
| Bug? | yes |
| New Feature? | no |
| Framework | Laravel |
| Framework version | 5.7.25 |
| Package version | >=8.0.3 |
| PHP version | 7.2.x |
Actual Behaviour
This PR here
https://github.com/owen-it/laravel-auditing/pull/448/files
For this issue (from what I understand):
#432
Will actually break any project using non-numeric (or non-integer) primary key IDs. In our case, we are using UUIDs (which I would think is quite common these days).
The end result is that any update to the underlying model will wipe all audits and it will no longer have any related audits.
Expected Behaviour
As laravel supports non-integer keys, so should this package. Update shouldn't break existing functionality.
Steps to Reproduce
Create a new model in Laravel with the following properties and as a string in the database (for field type)
/**
* @var bool Set to false for UUID keys
*/
public $incrementing = false;
/**
* @var string Set to string for UUID keys
*/
protected $keyType = 'string';Deploy the auditable trait on it, and see what happens on model update.
Possible Solutions
The auditable_id cast to integer needs to be removed
Metadata
Metadata
Assignees
Labels
No labels