<?php

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

class CreateTranslateLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('translate_logs', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->index();
            $table->tinyInteger('status')->default(0)->comment('0 翻译中 1 翻译完成');
            $table->text('exception')->nullable()->comment('异常信息');
            $table->timestamp('end_at')->nullable()->comment('翻译完成时间');
            $table->tinyInteger('type')->default(1)->comment('1 覆盖 2 跳过');
            $table->timestamps();
        });
    }

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