shop-back-end/sql/20250329_cabinet_cell_opera...

30 lines
1.7 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

DROP TABLE IF EXISTS `cabinet_cell_operation`;
CREATE TABLE `cabinet_cell_operation` (
`operation_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '操作流水号',
`cell_id` BIGINT NOT NULL COMMENT '关联格口ID',
`goods_id` BIGINT NOT NULL COMMENT '关联商品ID',
`goods_name` VARCHAR(255) NOT NULL COMMENT '商品名称',
`userid` varchar(100) NOT NULL COMMENT '企业微信用户ID',
`is_internal` TINYINT(1) DEFAULT 0 COMMENT '是否内部用户0否 1是',
`name` varchar(30) DEFAULT NULL COMMENT '成员名称',
`mobile` varchar(30) DEFAULT NULL COMMENT '手机号码',
`operation_type` TINYINT NOT NULL COMMENT '操作类型1用户 2管理员',
`status` TINYINT NOT NULL DEFAULT 1 COMMENT '操作状态1正常 2操作失败',
`creator_id` BIGINT NOT NULL DEFAULT 0 COMMENT '创建者ID',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater_id` BIGINT NOT NULL DEFAULT 0 COMMENT '更新者ID',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '删除标志0存在 1删除',
PRIMARY KEY (`operation_id`),
KEY `idx_cell` (`cell_id`),
KEY `idx_user` (`userid`),
KEY `idx_operation_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='柜机格口操作记录表';
ALTER TABLE `shop_goods`
ADD COLUMN `auto_approval` TINYINT NOT NULL DEFAULT 0 COMMENT '免审批0否 1是' AFTER `status`;
ALTER TABLE `shop_order`
ADD COLUMN `is_deduct_stock` TINYINT NOT NULL DEFAULT 0 COMMENT '已扣减库存0否 1是' AFTER `pay_status`;