diff --git a/database/migrations/2026_02_27_100001_add_columns_to_approvals_table.php b/database/migrations/2026_02_27_100001_add_columns_to_approvals_table.php new file mode 100644 index 0000000..8fc2dca --- /dev/null +++ b/database/migrations/2026_02_27_100001_add_columns_to_approvals_table.php @@ -0,0 +1,37 @@ +foreignId('line_id')->nullable()->after('form_id') + ->constrained('approval_lines')->nullOnDelete() + ->comment('결재선 템플릿 ID'); + $table->longText('body')->nullable()->after('content') + ->comment('본문 내용'); + $table->boolean('is_urgent')->default(false)->after('status') + ->comment('긴급 여부'); + $table->unsignedBigInteger('department_id')->nullable()->after('drafter_id') + ->comment('기안 부서 ID'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('approvals', function (Blueprint $table) { + $table->dropForeign(['line_id']); + $table->dropColumn(['line_id', 'body', 'is_urgent', 'department_id']); + }); + } +}; diff --git a/database/migrations/2026_02_27_100002_add_columns_to_approval_steps_table.php b/database/migrations/2026_02_27_100002_add_columns_to_approval_steps_table.php new file mode 100644 index 0000000..99e0fa8 --- /dev/null +++ b/database/migrations/2026_02_27_100002_add_columns_to_approval_steps_table.php @@ -0,0 +1,33 @@ +string('approver_name', 50)->nullable()->after('approver_id') + ->comment('결재자명 스냅샷'); + $table->string('approver_department', 100)->nullable()->after('approver_name') + ->comment('결재자 부서 스냅샷'); + $table->string('approver_position', 50)->nullable()->after('approver_department') + ->comment('결재자 직급 스냅샷'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('approval_steps', function (Blueprint $table) { + $table->dropColumn(['approver_name', 'approver_department', 'approver_position']); + }); + } +};