Files
sam-api/database/migrations/2026_02_05_700000_create_holidays_table.php
김보곤 70aab06364 feat:holidays 테이블 마이그레이션 생성
달력 휴일 관리를 위한 holidays 테이블 추가 (시작일/종료일, 유형, 반복 여부)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 19:59:31 +09:00

35 lines
1.3 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('holidays', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->date('start_date')->comment('시작일');
$table->date('end_date')->comment('종료일 (단일 휴일이면 start_date와 동일)');
$table->string('name', 100)->comment('휴일명');
$table->string('type', 30)->default('public')->comment('유형: public(공휴일), company(회사지정), etc');
$table->boolean('is_recurring')->default(false)->comment('매년 반복 여부');
$table->text('memo')->nullable()->comment('메모');
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index(['tenant_id', 'start_date']);
$table->index(['tenant_id', 'end_date']);
});
}
public function down(): void
{
Schema::dropIfExists('holidays');
}
};