- TenantSetting CRUD API 추가 - Calendar, Entertainment, VAT 서비스 개선 - 5130 BOM 계산 로직 수정 - quote_items에 item_type 컬럼 추가 - tenant_settings 테이블 마이그레이션 - Swagger 문서 업데이트
51 lines
2.2 KiB
PHP
51 lines
2.2 KiB
PHP
<?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::create('schedules', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedBigInteger('tenant_id')->nullable()->comment('NULL이면 전체 테넌트 공통 (본사 등록)');
|
|
$table->string('title', 200)->comment('일정 제목');
|
|
$table->text('description')->nullable()->comment('일정 설명');
|
|
$table->date('start_date')->comment('시작일');
|
|
$table->date('end_date')->nullable()->comment('종료일 (NULL이면 당일)');
|
|
$table->time('start_time')->nullable()->comment('시작 시간');
|
|
$table->time('end_time')->nullable()->comment('종료 시간');
|
|
$table->boolean('is_all_day')->default(true)->comment('종일 여부');
|
|
$table->string('type', 50)->default('event')->comment('일정 유형: tax, holiday, event, notice, meeting, other');
|
|
$table->boolean('is_recurring')->default(false)->comment('반복 일정 여부');
|
|
$table->string('recurrence_rule', 50)->nullable()->comment('반복 규칙: yearly, quarterly, monthly, weekly');
|
|
$table->string('color', 20)->nullable()->comment('캘린더 표시 색상');
|
|
$table->boolean('is_active')->default(true)->comment('활성 여부');
|
|
$table->unsignedBigInteger('created_by')->nullable()->comment('생성자');
|
|
$table->unsignedBigInteger('updated_by')->nullable()->comment('수정자');
|
|
$table->unsignedBigInteger('deleted_by')->nullable()->comment('삭제자');
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
|
|
// 인덱스
|
|
$table->index('tenant_id');
|
|
$table->index('type');
|
|
$table->index('start_date');
|
|
$table->index(['tenant_id', 'type', 'start_date']);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('schedules');
|
|
}
|
|
};
|