feat:[interview] AI 대화형 인터뷰 conversations 테이블 및 모델 추가
This commit is contained in:
41
app/Models/Interview/InterviewAiConversation.php
Normal file
41
app/Models/Interview/InterviewAiConversation.php
Normal 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');
|
||||
}
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user