From a4a0248a83cb422702da9098aa07f0f6bfd402fd Mon Sep 17 00:00:00 2001 From: hskwon Date: Tue, 2 Dec 2025 16:31:34 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20products=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=20category=5Fid=20=EA=B8=B0=EB=B3=B8=EA=B0=92=200=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - category_id 필드에 기본값이 없어 INSERT 오류 발생하던 문제 해결 --- ...products_table_set_category_id_default.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2025_12_02_163035_alter_products_table_set_category_id_default.php diff --git a/database/migrations/2025_12_02_163035_alter_products_table_set_category_id_default.php b/database/migrations/2025_12_02_163035_alter_products_table_set_category_id_default.php new file mode 100644 index 0000000..bc4abb2 --- /dev/null +++ b/database/migrations/2025_12_02_163035_alter_products_table_set_category_id_default.php @@ -0,0 +1,28 @@ +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(); + }); + } +}; \ No newline at end of file