<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePromptTaskTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('prompt_task', function (Blueprint $table) {
            $table->increments('id');
            $table->text('prompt');
            $table->integer('user_id')->default('0');
            $table->integer('task_id')->default('0');
            $table->text('prompt_img')->nullable();
            $table->string('result_img')->default('');
            $table->integer('result_img_status')->default('0');
            $table->string('type')->default('');
            # 任务失败原因
            $table->text('message')->nullable();
            # 切割图片状态
            $table->integer('cut_status')->default('0');
            # 切割图片的id
            $table->integer('cut_id')->default('0');
            # 切割后的图片
            $table->text('cut_img')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('prompt_task');
    }
}
