Files
BMS/bms-back/sql/system/biz_attachment.sql
T
2026-10-16 13:40:03 +08:00

23 lines
1.4 KiB
SQL
Raw 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.
-- 公共业务附件表(可复用:批量修改计费重导入等)
SET NAMES utf8mb4;
CREATE TABLE IF NOT EXISTS biz_attachment (
attachment_id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '附件ID',
biz_type varchar(64) NOT NULL COMMENT '业务类型(如 CHARGE_WEIGHT_IMPORT)',
biz_id varchar(64) DEFAULT NULL COMMENT '业务关联ID(如导入任务taskId)',
file_name varchar(255) NOT NULL COMMENT '文件原始名称',
file_path varchar(500) NOT NULL COMMENT '存储路径(相对路径)',
file_size bigint(20) DEFAULT 0 COMMENT '文件大小(字节)',
content_type varchar(100) DEFAULT '' COMMENT 'MIME类型',
file_extension varchar(20) DEFAULT '' COMMENT '扩展名',
remark varchar(500) DEFAULT NULL COMMENT '备注',
create_by varchar(64) DEFAULT '' COMMENT '创建人',
create_time datetime DEFAULT NULL COMMENT '创建时间',
update_by varchar(64) DEFAULT '' COMMENT '更新人',
update_time datetime DEFAULT NULL COMMENT '更新时间',
del_flag char(1) DEFAULT '0' COMMENT '删除标志(0存在 2删除)',
PRIMARY KEY (attachment_id),
KEY idx_biz_attach_type_time (biz_type, create_time),
KEY idx_biz_attach_biz_id (biz_type, biz_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共业务附件';