-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 9.23.0
- Nova Version: 4.12.14
- PHP Version: 8.1.8
- Database Driver & Version: mysql 8.0.28
- Operating System and Version: macOS 12.5
- Browser type and version: Firefox 103
Description:
I have a Nova model, for which my use case requires a non-integer primary key (mysql: varchar).
In general this works fine with Nova, but it seems to cause an issue with the Action queue.
Detailed steps to reproduce the issue on a fresh Nova installation:
I've created my database table using
Schema::create('appointments', function (Blueprint $table) {
$table->string('id', 50)->primary();
...
}
in my migration. My entity class "Appointment" repeats this primary key column
ID::make(__('ID'), 'id')
, which works fine in the first place. I create an Action using the proposed way
php artisan nova:action CreatePatient
and call it from my Appointment using
public function actions(NovaRequest $request): array
{
return [
(new CreatePatient)
];
}
When I now try to run this action, this fails with the following database queue issue:
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'er78fbub2j0gvs' for column 'actionable_id' at row 1 (SQL: insert into "action_events' (' actionable_id', "actionable_type', "batch_id', 'changes", "'created_at', 'exception', fields', 'model_id', 'model type', 'name', 'original', 'status', 'target_id', 'target type', 'updated _at', 'user id') values (er78fbub2j0gvs, App\Models\Appointment, 9707ad3a-86ef-486b-9138-be7631af25ee, ?, 2022-08-15 21:37:48, , a:0:(), er78fbub2j0gvs, App\Models\Appointment, Create patient, ?, running, er78fbub2j0gvs, App\Models\Appointment, 2022-08-15 21:37:48, 2))
Proposal: The Nova queue database table should better use a varchar primary key to stay flexible. In most setups, the performance implication will be minor.
Metadata
Metadata
Assignees
Labels
No labels