Files
sam-api/database/migrations/2025_12_30_091821_create_positions_table.php
kent 1044b57e15 chore(API): 마이그레이션 파일 정리 및 추가
- 기존 마이그레이션 파일 정리
- handover_reports 테이블 마이그레이션 추가
- site_briefings 테이블 마이그레이션 추가
- work_orders process_id 마이그레이션 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:23 +09:00

31 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');
}
};