-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
versionable_id as uuid #47
Comments
@alex-mcarrow If you want to support the uuid format, you need to change the versionable_id field to the corresponding format: php artisan vendor:publish --provider="Overtrue\LaravelVersionable\ServiceProvider" --tag=migrations Then change it to: database/migrations/2019_05_31_042934_create_versions_table.php -$table->morphs('versionable');
$table->uuidMorphs('versionable'); Then run migrate command: PHP artisan migrate |
Yep FYI I did this a few months ago and it's been fine. @overtrue it might be an idea to chuck it as a config option prior to migration? |
Good idea, I will add this feature in a few days, or feel free to make a PR. Thanks. |
versionable_id throw error because id is UUID:
SQLSTATE[01000]: Warning: 1265 Data truncated for column 'versionable_id' at row 1 (Connection: mysql, SQL: insert into
versions
(versionable_id
,versionable_type
,user_id
,contents
,updated_at
,created_at
) values (98f5f55d-00f6-4577-8e1f-782526c17c27, App\Models\Contact, 1, {"last_name":"\u0439\u0446\u0443\u043ag1","updated_at":"2023-04-19T11:53:18.000000Z"}, 2023-04-19 14:53:18, 2023-04-19 14:53:18))The text was updated successfully, but these errors were encountered: