feat:[interview] AI 대화형 인터뷰 conversations 테이블 및 모델 추가

This commit is contained in:
김보곤
2026-03-22 22:35:44 +09:00
parent 0b4612abfc
commit 24c2aa342f
2 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Models\Interview;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;
class InterviewAiConversation extends Model
{
use BelongsToTenant, ModelTrait;
const UPDATED_AT = null;
protected $fillable = [
'tenant_id',
'interview_session_id',
'interview_project_id',
'role',
'content',
'structured_data',
'domain',
'tokens_used',
'model_used',
];
protected $casts = [
'structured_data' => 'array',
'tokens_used' => 'integer',
];
public function session()
{
return $this->belongsTo(InterviewSession::class, 'interview_session_id');
}
public function project()
{
return $this->belongsTo(InterviewProject::class, 'interview_project_id');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('interview_ai_conversations', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('tenant_id')->index();
$table->unsignedBigInteger('interview_session_id')->nullable()->index();
$table->unsignedBigInteger('interview_project_id')->nullable()->index();
$table->string('role', 20); // system, user, assistant
$table->text('content');
$table->json('structured_data')->nullable();
$table->string('domain', 50)->nullable();
$table->integer('tokens_used')->nullable();
$table->string('model_used', 50)->nullable();
$table->timestamp('created_at')->useCurrent();
$table->index(['tenant_id', 'interview_session_id']);
});
}
public function down(): void
{
Schema::dropIfExists('interview_ai_conversations');
}
};