feat: fcm_send_logs 테이블 마이그레이션 추가

This commit is contained in:
2025-12-19 10:11:51 +09:00
parent 10a64fb0a5
commit c7b25710a0
2 changed files with 49 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
# 논리적 데이터베이스 관계 문서
> **자동 생성**: 2025-12-18 19:32:06
> **자동 생성**: 2025-12-19 10:11:32
> **소스**: Eloquent 모델 관계 분석
## 📊 모델별 관계 현황

View File

@@ -0,0 +1,48 @@
<?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('fcm_send_logs', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
$table->foreignId('user_id')->nullable()->comment('대상 사용자');
$table->foreignId('sender_id')->nullable()->comment('발송자 (MNG 관리자)');
$table->string('title');
$table->text('body');
$table->string('channel_id', 50)->default('push_default');
$table->string('type', 50)->nullable()->comment('알림 타입');
$table->string('platform', 20)->nullable()->comment('대상 플랫폼');
$table->json('data')->nullable()->comment('추가 데이터');
$table->unsignedInteger('total_count')->default(0);
$table->unsignedInteger('success_count')->default(0);
$table->unsignedInteger('failure_count')->default(0);
$table->unsignedInteger('invalid_token_count')->default(0);
$table->decimal('success_rate', 5, 2)->default(0);
$table->string('status', 20)->default('pending')->comment('pending, sending, completed, failed');
$table->text('error_message')->nullable();
$table->timestamp('completed_at')->nullable();
$table->timestamps();
$table->index(['tenant_id', 'created_at']);
$table->index(['status', 'created_at']);
$table->index('sender_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('fcm_send_logs');
}
};