feat:공사현장 사진대지 테이블 마이그레이션 추가

construction_site_photos 테이블 생성 (현장명, 작업일자, 작업전/작업중/작업후 사진 GCS 경로)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-09 21:25:03 +09:00
parent 0bd470a6f8
commit 4c02ff64f1

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('construction_site_photos', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id')->comment('테넌트 ID');
$table->unsignedBigInteger('user_id')->comment('등록자 ID');
$table->string('site_name', 200)->comment('현장명');
$table->date('work_date')->comment('작업일자');
$table->text('description')->nullable()->comment('설명');
// 작업전 사진
$table->string('before_photo_path', 500)->nullable()->comment('작업전 사진 GCS 경로');
$table->string('before_photo_gcs_uri', 500)->nullable()->comment('작업전 사진 GCS URI');
$table->unsignedInteger('before_photo_size')->nullable()->comment('작업전 사진 파일크기(bytes)');
// 작업중 사진
$table->string('during_photo_path', 500)->nullable()->comment('작업중 사진 GCS 경로');
$table->string('during_photo_gcs_uri', 500)->nullable()->comment('작업중 사진 GCS URI');
$table->unsignedInteger('during_photo_size')->nullable()->comment('작업중 사진 파일크기(bytes)');
// 작업후 사진
$table->string('after_photo_path', 500)->nullable()->comment('작업후 사진 GCS 경로');
$table->string('after_photo_gcs_uri', 500)->nullable()->comment('작업후 사진 GCS URI');
$table->unsignedInteger('after_photo_size')->nullable()->comment('작업후 사진 파일크기(bytes)');
$table->timestamps();
$table->softDeletes();
$table->index('tenant_id', 'idx_csp_tenant');
$table->index('user_id', 'idx_csp_user');
$table->index(['tenant_id', 'work_date'], 'idx_csp_tenant_work_date');
});
}
public function down(): void
{
Schema::dropIfExists('construction_site_photos');
}
};