diff --git a/database/migrations/2026_02_03_110000_add_user_id_and_linked_fields_to_document_templates.php b/database/migrations/2026_02_03_110000_add_user_id_and_linked_fields_to_document_templates.php new file mode 100644 index 0000000..06b2073 --- /dev/null +++ b/database/migrations/2026_02_03_110000_add_user_id_and_linked_fields_to_document_templates.php @@ -0,0 +1,36 @@ +unsignedBigInteger('user_id')->nullable()->after('role') + ->comment('담당자 ID (작성 단계는 null)'); + }); + + // 문서양식에 연결 필드 추가 + Schema::table('document_templates', function (Blueprint $table) { + $table->json('linked_item_ids')->nullable()->after('is_active') + ->comment('수입검사 시 연결된 품목 ID 배열'); + $table->unsignedBigInteger('linked_process_id')->nullable()->after('linked_item_ids') + ->comment('품질검사 시 연결된 공정 ID'); + }); + } + + public function down(): void + { + Schema::table('document_template_approval_lines', function (Blueprint $table) { + $table->dropColumn('user_id'); + }); + + Schema::table('document_templates', function (Blueprint $table) { + $table->dropColumn(['linked_item_ids', 'linked_process_id']); + }); + } +};