fix: products 테이블 category_id 기본값 0 설정

- category_id 필드에 기본값이 없어 INSERT 오류 발생하던 문제 해결
This commit is contained in:
2025-12-02 16:31:34 +09:00
parent 88794c3ce4
commit a4a0248a83

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('products', function (Blueprint $table) {
$table->unsignedBigInteger('category_id')->default(0)->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
$table->unsignedBigInteger('category_id')->default(null)->change();
});
}
};