<?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_talk` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `title` varchar(255) NOT NULL COMMENT '话题标题',
  `content` text NOT NULL COMMENT '话题内容',
  `images` text COMMENT '话题背景图',
  `is_hot` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否热门 0:否 1:是',
  `sort` tinyint(4) NOT NULL DEFAULT '0' COMMENT '排序,数值越大越靠前',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否显示 0:显示 1:隐藏',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '话题类别 0:永久 1:限时',
  `start_date` varchar(32) DEFAULT NULL COMMENT '限时开始时间',
  `end_date` varchar(32) DEFAULT NULL COMMENT '限时结束时间',
  `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 `title` (`title`(191)) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='动态广场话题表';");
    }

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