Skip to content

Commit

Permalink
Fixed incompatible foreign key in customer purchases migration
Browse files Browse the repository at this point in the history
  • Loading branch information
molnarerwin committed Nov 22, 2024
1 parent 8394474 commit c482a82
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ public function up(): void
{
Schema::create('customer_purchases', function (Blueprint $table) {
$table->id();
$table->foreignId('customer_id')->constrained()->onDelete('cascade');
$table->integer('customer_id')->unsigned();
$table->date('purchase_date')->nullable();
$table->decimal('purchase_value')->nullable();
$table->char('currency', 3)->nullable();
$table->morphs('purchasable');
$table->timestamps();

$table->foreign('customer_id')
->references('id')
->on('customers')
->onDelete('cascade');
});
}

Expand Down

0 comments on commit c482a82

Please sign in to comment.