id(); // πŸ”΄ ν•„μˆ˜ 컬럼 (쑰인/인덱싱) $table->foreignId('tenant_id')->constrained()->cascadeOnDelete(); $table->string('target_type', 20)->default('all')->comment('λŒ€μƒ μœ ν˜•: all, department'); $table->unsignedBigInteger('target_id')->nullable()->comment('λŒ€μƒ ID (λΆ€μ„œ ID)'); $table->string('title', 200)->comment('제λͺ©'); $table->text('content')->comment('λ‚΄μš©'); $table->string('status', 20)->default('inactive')->index()->comment('μƒνƒœ: active, inactive'); $table->dateTime('started_at')->nullable()->index()->comment('λ…ΈμΆœ μ‹œμž‘μΌ'); $table->dateTime('ended_at')->nullable()->index()->comment('λ…ΈμΆœ μ’…λ£ŒμΌ'); // 🟒 κ°€λ³€ 컬럼 (JSON) $table->json('options')->nullable()->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('target_type'); $table->index(['tenant_id', 'status', 'started_at', 'ended_at']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('popups'); } };