<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::statement("CREATE TABLE `ufutx_dynamic_comment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `square_id` int(11) NOT NULL COMMENT '动态id',
  `user_id` int(11) NOT NULL COMMENT '评论用户id',
  `to_user_id` int(11) NOT NULL COMMENT '被评论用户id',
  `content` text COMMENT '评论内容',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '评论类型 0:评论动态 1:回复评论',
  `comment_id` int(11) DEFAULT NULL COMMENT '回复某个评论的id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT '修改时间',
  `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`) USING BTREE,
  KEY `square_id` (`square_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='动态广场评论表';");
    }

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