feat: [approval] 결재관리 Phase 1 마이그레이션

- approvals 테이블: line_id, body, is_urgent, department_id 컬럼 추가
- approval_steps 테이블: approver_name, approver_department, approver_position 스냅샷 컬럼 추가
This commit is contained in:
김보곤
2026-02-27 23:17:03 +09:00
parent 2ed90dc6db
commit b80f4a0392
2 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('approvals', function (Blueprint $table) {
$table->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']);
});
}
};

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('approval_steps', function (Blueprint $table) {
$table->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']);
});
}
};