feat:holidays 테이블 마이그레이션 생성
달력 휴일 관리를 위한 holidays 테이블 추가 (시작일/종료일, 유형, 반복 여부) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user