feat(阶段三): 添加知识库模型和迁移
- 创建 knowledge_bases 表迁移 - 创建 KnowledgeBase 模型 - 创建 KnowledgeBaseFactory 工厂类 - 支持与终端的多对多关联关系
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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('knowledge_bases', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->comment('知识库名称');
|
||||
$table->text('description')->nullable()->comment('知识库描述');
|
||||
$table->string('status')->default('active')->comment('状态');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('knowledge_bases');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user