<?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()
    {
        // 执行原生 SQL 语句
        DB::statement("CREATE TABLE `ufutx_s2_real_object` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(256) NOT NULL COMMENT '实物名称',
  `description` text COMMENT '实物描述',
  `images` varchar(512) DEFAULT NULL COMMENT '图片多张',
  `stock` int(11) NOT NULL DEFAULT '0' COMMENT '库存',
  `unit` varchar(64) NOT NULL COMMENT '基础计量单位,如:瓶/个/克',
  `base_quantity` int(10) UNSIGNED NOT NULL DEFAULT '1' COMMENT '基础堆叠数量'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品实物表';");
    }

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