From 6c2e74d6ce16167e85810b51e869bb317853417f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 3 Feb 2026 11:24:04 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EC=B0=A8=EB=9F=89=EC=9D=BC=EC=A7=80(?= =?UTF-8?q?=EC=9A=B4=ED=96=89=EA=B8=B0=EB=A1=9D=EB=B6=80)=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - vehicle_logs 테이블 생성 - 운행 정보 (날짜, 부서, 운전자, 구분) - 출발지/도착지 정보 (분류, 장소명, 주소) - 주행거리, 비고 Co-Authored-By: Claude Opus 4.5 --- ...02_03_100000_create_vehicle_logs_table.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 database/migrations/2026_02_03_100000_create_vehicle_logs_table.php diff --git a/database/migrations/2026_02_03_100000_create_vehicle_logs_table.php b/database/migrations/2026_02_03_100000_create_vehicle_logs_table.php new file mode 100644 index 0000000..ccfc7af --- /dev/null +++ b/database/migrations/2026_02_03_100000_create_vehicle_logs_table.php @@ -0,0 +1,54 @@ +id(); + $table->unsignedBigInteger('tenant_id')->index(); + $table->unsignedBigInteger('vehicle_id')->index(); + + // 운행 정보 + $table->date('log_date')->comment('운행 날짜'); + $table->string('department', 50)->nullable()->comment('부서'); + $table->string('driver_name', 50)->comment('운전자 성명'); + $table->enum('trip_type', ['commute_to', 'commute_from', 'business', 'personal']) + ->comment('구분: 출근용, 퇴근용, 업무용, 비업무'); + + // 출발지 + $table->enum('departure_type', ['home', 'office', 'client', 'other'])->nullable() + ->comment('출발지 분류: 자택, 회사, 거래처, 기타'); + $table->string('departure_name', 100)->nullable()->comment('출발지명'); + $table->string('departure_address', 200)->nullable()->comment('출발지 주소'); + + // 도착지 + $table->enum('arrival_type', ['home', 'office', 'client', 'other'])->nullable() + ->comment('도착지 분류: 자택, 회사, 거래처, 기타'); + $table->string('arrival_name', 100)->nullable()->comment('도착지명'); + $table->string('arrival_address', 200)->nullable()->comment('도착지 주소'); + + // 주행 정보 + $table->unsignedInteger('distance_km')->comment('주행거리(km)'); + $table->string('note', 200)->nullable()->comment('비고'); + + $table->timestamps(); + $table->softDeletes(); + + // 외래키 + $table->foreign('vehicle_id')->references('id')->on('corporate_vehicles')->cascadeOnDelete(); + + // 인덱스 + $table->index(['tenant_id', 'vehicle_id', 'log_date']); + }); + } + + public function down(): void + { + Schema::dropIfExists('vehicle_logs'); + } +};