You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mes-heli/sql/v1.1.0/heli.sql

58 lines
5.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

ALTER TABLE system_operate_log MODIFY COLUMN `result_data` TEXT COMMENT '结果数据';
ALTER TABLE system_operate_log MODIFY COLUMN `java_method_args` TEXT COMMENT 'Java 方法的参数';
ALTER TABLE system_operate_log MODIFY COLUMN `content` TEXT COMMENT '操作内容';
ALTER TABLE system_operate_log ADD COLUMN `business_id` bigint(20) DEFAULT NULL COMMENT '业务id' AFTER trace_id;
ALTER TABLE system_operate_log ADD COLUMN `business_type` varchar(32) COMMENT '业务类型 用于业务关联' AFTER trace_id;
ALTER TABLE system_operate_log add INDEX `idx_business`(`business_type`,`business_id`);
ALTER TABLE infra_file ADD COLUMN business_file_type varchar(32) COMMENT '业务文件类型 用于区分不同业务类型文件' after business_id;
ALTER TABLE infra_file ADD INDEX `idx_business`(`business_type`,`business_id`,`business_file_type`);
DROP TABLE IF EXISTS `wms_storage`;
CREATE TABLE `wms_storage` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`stock_type` tinyint(1) NOT NULL COMMENT '入库出库大类型1为入库2为出库',
`stock_in_type` tinyint(1) NULL COMMENT '入库类型(字典)1为采购入库2为盘盈入库3为其他入库',
`stock_out_type` tinyint(1) NULL COMMENT '出库类型(字典)1为领料出库2为销售出库3为盘亏出库4为其他出库',
`stock_no` varchar(20) NOT NULL COMMENT '入/出库单号',
`header_no` bigint(20) NULL DEFAULT NULL COMMENT '上游单号',
`description` varchar(255) NULL DEFAULT NULL COMMENT '备注',
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态1为保存2为提交3为作废',
`wh_id` bigint(19) NOT NULL COMMENT '仓库Id对应 wms_wh 表中的Id',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '逻辑删除 1.是,0.否',
`creator` varchar(64) NOT NULL COMMENT '记录的创建人,对应员工表中的 Id',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) NULL DEFAULT NULL COMMENT '记录的修改人,对应员工表中的 Id',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`tenant_id` bigint(20) NOT NULL COMMENT '租户编号',
`keeper` bigint(20) NULL DEFAULT NULL COMMENT '入库人',
`keeper_time` datetime NULL DEFAULT NULL COMMENT '入库时间',
`outer` bigint(20) NULL DEFAULT NULL COMMENT '出库人',
`outer_time` datetime NULL DEFAULT NULL COMMENT '出库时间',
`cancel` bigint(20) NULL DEFAULT NULL COMMENT '作废人',
`cancel_time` datetime NULL DEFAULT NULL COMMENT '作废时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '入/出库表' ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `wms_storage_mat`;
CREATE TABLE `wms_storage_mat` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`stock_id` bigint(20) NOT NULL COMMENT '入/出库Id',
`mat_id` bigint(19) NOT NULL COMMENT '物料 Id,对应 base_material表中的 Id 列',
`wh_id` bigint(19) NOT NULL COMMENT '仓库 Id对应 wms_wh 表中的Id',
`rg_id` bigint(19) NOT NULL COMMENT '库区 Id对应 wms_rg 表中的Id',
`pn_id` bigint(19) NOT NULL COMMENT '库区 Id对应 wms_rg 表中的Id',
`storage_ok_qty` decimal(11, 2) NULL DEFAULT NULL COMMENT '库存良品数量',
`lot_no` varchar(50) NULL DEFAULT NULL COMMENT '批次号',
`description` varchar(255) NULL DEFAULT NULL COMMENT '备注',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '逻辑删除 1.是,0.否',
`creator` varchar(64) NOT NULL COMMENT '记录的创建人,对应员工表中的 Id',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) NULL DEFAULT NULL COMMENT '记录的修改人,对应员工表中的 Id',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`tenant_id` bigint(20) NOT NULL COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '入/出库物料表' ROW_FORMAT = DYNAMIC;