-- ****************************************************************** -- 表 kku_mex_warehouse 的创建SQL -- 对应的Model: App\Module\Mex\Models\MexWarehouse -- 警告: 此文件由系统自动生成,禁止修改! -- ****************************************************************** CREATE TABLE `kku_mex_warehouse` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID,主键', `item_id` int(11) NOT NULL COMMENT '商品ID,关联物品表', `quantity` int(11) NOT NULL DEFAULT '0' COMMENT '库存数量', `total_buy_amount` decimal(20,5) DEFAULT '0.00000' COMMENT '累计买入金额', `total_sell_amount` decimal(20,5) DEFAULT '0.00000' COMMENT '累计卖出金额', `total_buy_quantity` int(11) DEFAULT '0' COMMENT '累计买入数量', `total_sell_quantity` int(11) DEFAULT '0' COMMENT '累计卖出数量', `last_transaction_at` timestamp NULL DEFAULT NULL COMMENT '最后交易时间', `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `uk_item_id` (`item_id`) USING BTREE, KEY `idx_quantity` (`quantity`) USING BTREE, KEY `idx_last_transaction_at` (`last_transaction_at`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='农贸市场系统仓库表';