feat: fcm_send_logs 테이블 마이그레이션 추가
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 논리적 데이터베이스 관계 문서
|
||||
|
||||
> **자동 생성**: 2025-12-18 19:32:06
|
||||
> **자동 생성**: 2025-12-19 10:11:32
|
||||
> **소스**: Eloquent 모델 관계 분석
|
||||
|
||||
## 📊 모델별 관계 현황
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user