diff --git a/database/migrations/2026_02_09_200000_create_construction_site_photos_table.php b/database/migrations/2026_02_09_200000_create_construction_site_photos_table.php new file mode 100644 index 0000000..c0e1291 --- /dev/null +++ b/database/migrations/2026_02_09_200000_create_construction_site_photos_table.php @@ -0,0 +1,48 @@ +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'); + } +};