feat(migration): 添加表存在检查以避免重复创建表

This commit is contained in:
kuaifan 2026-04-04 00:58:45 +00:00
parent ed2f843815
commit c798faa8db
2 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,9 @@ class CreateManticoreSyncFailuresTable extends Migration
*/
public function up()
{
if (Schema::hasTable('manticore_sync_failures')) {
return;
}
Schema::create('manticore_sync_failures', function (Blueprint $table) {
$table->id();
$table->string('data_type', 20)->comment('数据类型: msg/file/task/project/user');

View File

@ -8,6 +8,9 @@ class CreateProjectTaskAiEventsTable extends Migration
{
public function up()
{
if (Schema::hasTable('project_task_ai_events')) {
return;
}
Schema::create('project_task_ai_events', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('task_id')->comment('任务ID');