<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('talk_comment', function (Blueprint $table) {
            $table->integer('comment_id')->nullable()->comment('回复评论的id')->after('content');
            $table->tinyInteger('type')->default(0)->comment('0:评论话题 1:回复评论')->after('comment_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('talk_comment', function (Blueprint $table) {
            $table->dropColumn('comment_id');
            $table->dropColumn('type');
        });
    }
};
