fix: product_action_runs.action_id must be uuidMorphs (ProductAction is HasUuids)
morphs('action') creates a bigint action_id, but ProductAction uses HasUuids — so ProductAction::callForProduct's run-logging dies with 'Incorrect integer value: <uuid>' on the first dispatch. uuidMorphs('action') matches the uuid key. Fresh-install fix; existing installs need an in-place widen.
This commit is contained in:
parent
8594af4236
commit
7d35c224f3
|
|
@ -378,7 +378,10 @@ return new class extends Migration
|
||||||
if (!Schema::hasTable(config('shop.tables.product_action_runs', 'product_action_runs'))) {
|
if (!Schema::hasTable(config('shop.tables.product_action_runs', 'product_action_runs'))) {
|
||||||
Schema::create(config('shop.tables.product_action_runs', 'product_action_runs'), function (Blueprint $table) {
|
Schema::create(config('shop.tables.product_action_runs', 'product_action_runs'), function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->morphs('action');
|
// ProductAction uses HasUuids, so action_id must be a uuid/char(36),
|
||||||
|
// not the bigint that morphs() creates — otherwise logging a run
|
||||||
|
// (callForProduct) dies with "Incorrect integer value: '<uuid>'".
|
||||||
|
$table->uuidMorphs('action');
|
||||||
$table->uuid('product_purchase_id')->nullable();
|
$table->uuid('product_purchase_id')->nullable();
|
||||||
$table->boolean('success')->default(false);
|
$table->boolean('success')->default(false);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue