uuid('id')->primary(); $table->string('title'); $table->unsignedTinyInteger('progress')->nullable(); $table->enum('status', ['pending', 'done', 'success', 'failed', 'error', 'cancelled', 'processing', 'need_operation'])->index(); $table->unsignedBigInteger('user_id')->index(); $table->unsignedBigInteger('host_id')->index(); $table->string('module_id')->nullable()->index(); $table->timestamps(); }); // 设置存储引擎为 MEMORY DB::statement('ALTER TABLE tasks ENGINE = MEMORY'); } /** * Reverse the migrations. * * @return void */ public function down(): void { Schema::dropIfExists('tasks'); } };