Files
sam-api/database/migrations/2025_12_30_091821_create_positions_table.php
kent 75576323fe feat(API): Position API 추가 (직급/직책 통합)
- Position 모델 생성 (type: rank | title)
- PositionService: CRUD + reorder 구현
- PositionController: REST API 엔드포인트
- Swagger 문서 작성 (PositionApi.php)
- 마이그레이션: positions 테이블 + common_codes 등록
- routes/api.php에 라우트 등록

Phase L-3 (직급관리), L-4 (직책관리) 백엔드 완료

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 11:18:17 +09:00

30 lines
1.0 KiB
PHP

<?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::create('positions', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->comment('테넌트 ID');
$table->string('type', 20)->comment('유형: rank(직급), title(직책)');
$table->string('name', 50)->comment('명칭');
$table->integer('sort_order')->default(0)->comment('정렬 순서');
$table->boolean('is_active')->default(true)->comment('활성화 여부');
$table->timestamps();
$table->softDeletes();
$table->index(['tenant_id', 'type', 'sort_order']);
$table->unique(['tenant_id', 'type', 'name', 'deleted_at'], 'positions_tenant_type_name_unique');
});
}
public function down(): void
{
Schema::dropIfExists('positions');
}
};