<?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_square` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '动态类型 0:文本 1:图片 2:视频 3:语音 10:文本+图片 11:文本+视频 12:文本+语音',
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `title` text COMMENT '动态标题',
  `url` longtext COMMENT '地址',
  `talk_ids` varchar(32) DEFAULT NULL COMMENT '话题id',
  `address` varchar(255) DEFAULT NULL COMMENT '动态定位地址',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:审核中 1:审核中 已发布 2:拒绝',
  `longitude` varchar(32) DEFAULT NULL COMMENT '经度',
  `latitude` varchar(32) DEFAULT NULL COMMENT '维度',
  `resources` text 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 `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='动态表';");
    }

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