MySQL建表SQL语句
数据库结构:ShopXO商城-订单商品库存变更日志:https://open.yesapi.cn/tablelist/yesapi_shopxo_s_order_goods_inventory_log.html
-- 数据库大全:ShopXO商城-订单商品库存变更日志
-- 来源:YesApi.cn
CREATE TABLE `yesapi_shopxo_s_order_goods_inventory_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单id',
`goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
`order_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)',
`original_inventory` int(11) NOT NULL DEFAULT '0' COMMENT '原库存',
`new_inventory` int(11) NOT NULL DEFAULT '0' COMMENT '最新库存',
`is_rollback` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否回滚(0否, 1是)',
`rollback_time` int(11) NOT NULL DEFAULT '0' COMMENT '回滚时间',
KEY `order_id` (`order_id`),
KEY `goods_id` (`goods_id`),
KEY `order_status` (`order_status`),
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT 'ShopXO商城-订单商品库存变更日志';
复制后,到数据库执行,即可创建此数据库表。
MySQL数据库表结构设计
第 1-7 条, 共 7 条.
字段名称 | 字段类型 | 字段默认值 | 是否允许为空 | 字段描述 | 索引 | 字段数据示例 |
---|---|---|---|---|---|---|
order_id | int(11) | 0 | 否 | 订单id | 普通索引 | 0 |
goods_id | int(11) | 0 | 否 | 商品id | 普通索引 | 0 |
order_status | tinyint(2) | 0 | 否 | 订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭) | 普通索引 | 0 |
original_inventory | int(11) | 0 | 否 | 原库存 | 无索引 | 0 |
new_inventory | int(11) | 0 | 否 | 最新库存 | 无索引 | 0 |
is_rollback | tinyint(1) | 0 | 否 | 是否回滚(0否, 1是) | 无索引 | 0 |
rollback_time | int(11) | 0 | 否 | 回滚时间 | 无索引 | 0 |