From c7b25710a01c00dea6fb7d77c9202f312c1d14bd Mon Sep 17 00:00:00 2001 From: hskwon Date: Fri, 19 Dec 2025 10:11:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20fcm=5Fsend=5Flogs=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LOGICAL_RELATIONSHIPS.md | 2 +- ...2_19_100000_create_fcm_send_logs_table.php | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2025_12_19_100000_create_fcm_send_logs_table.php diff --git a/LOGICAL_RELATIONSHIPS.md b/LOGICAL_RELATIONSHIPS.md index 87d5e7a..aa2857d 100644 --- a/LOGICAL_RELATIONSHIPS.md +++ b/LOGICAL_RELATIONSHIPS.md @@ -1,6 +1,6 @@ # 논리적 데이터베이스 관계 문서 -> **자동 생성**: 2025-12-18 19:32:06 +> **자동 생성**: 2025-12-19 10:11:32 > **소스**: Eloquent 모델 관계 분석 ## 📊 모델별 관계 현황 diff --git a/database/migrations/2025_12_19_100000_create_fcm_send_logs_table.php b/database/migrations/2025_12_19_100000_create_fcm_send_logs_table.php new file mode 100644 index 0000000..0c27d24 --- /dev/null +++ b/database/migrations/2025_12_19_100000_create_fcm_send_logs_table.php @@ -0,0 +1,48 @@ +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'); + } +};