From ff829ad184084359b318af4c0bb30fad67338abe Mon Sep 17 00:00:00 2001 From: pro Date: Thu, 29 Jan 2026 16:31:50 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EA=B0=80=EC=9E=85=EB=B9=84(registration?= =?UTF-8?q?=5Ffee)=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80=20=EB=B0=8F?= =?UTF-8?q?=20=EC=8B=9C=EB=8D=94=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gistration_fee_to_sales_products_table.php | 32 +++++++++++++++++++ database/seeders/SalesProductSeeder.php | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 database/migrations/2026_01_29_162847_add_registration_fee_to_sales_products_table.php diff --git a/database/migrations/2026_01_29_162847_add_registration_fee_to_sales_products_table.php b/database/migrations/2026_01_29_162847_add_registration_fee_to_sales_products_table.php new file mode 100644 index 0000000..4a6aa96 --- /dev/null +++ b/database/migrations/2026_01_29_162847_add_registration_fee_to_sales_products_table.php @@ -0,0 +1,32 @@ +decimal('registration_fee', 15, 2)->default(0)->after('development_fee')->comment('가입비 (할인된 가격)'); + }); + + // 기존 데이터: 가입비 = 개발비 × 25% + DB::statement('UPDATE sales_products SET registration_fee = development_fee * 0.25'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('sales_products', function (Blueprint $table) { + $table->dropColumn('registration_fee'); + }); + } +}; diff --git a/database/seeders/SalesProductSeeder.php b/database/seeders/SalesProductSeeder.php index 7501ad2..3e77387 100644 --- a/database/seeders/SalesProductSeeder.php +++ b/database/seeders/SalesProductSeeder.php @@ -153,6 +153,7 @@ public function run(): void DB::table('sales_products')->insert([ 'category_id' => $categoryIds['MANUFACTURER'], ...$product, + 'registration_fee' => $product['development_fee'] * 0.25, 'is_active' => true, 'created_at' => now(), 'updated_at' => now(), @@ -203,6 +204,7 @@ public function run(): void DB::table('sales_products')->insert([ 'category_id' => $categoryIds['CONSTRUCTION'], ...$product, + 'registration_fee' => $product['development_fee'] * 0.25, 'is_active' => true, 'created_at' => now(), 'updated_at' => now(),