feat: [receiving] 입고 성적서 파일 연결 기능 추가
- receivings 테이블에 certificate_file_id 컬럼 추가 (마이그레이션) - Receiving 모델에 certificateFile 관계 및 fillable/casts 추가 - Store/Update Request에 certificate_file_id 검증 규칙 추가 - ReceivingService index/show에 certificateFile eager loading 추가 - store/update 시 certificate_file_id 저장 처리 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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::table('receivings', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('certificate_file_id')
|
||||
->nullable()
|
||||
->after('options')
|
||||
->comment('업체 제공 성적서 파일 ID');
|
||||
|
||||
$table->foreign('certificate_file_id')
|
||||
->references('id')
|
||||
->on('files')
|
||||
->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('receivings', function (Blueprint $table) {
|
||||
$table->dropForeign(['certificate_file_id']);
|
||||
$table->dropColumn('certificate_file_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user