Files
senmesh-zc/backend/db/upgrade-20260914-upload-config.sql
KodouWZF 47273ae3fd init: 信创文件安全传输系统内外网本地 Docker 部署
包含 s-file 后端、React 前端、MeshSafe 安全检测对接,以及内外网两套
compose/nginx/配置(仅前端 28180/28280 对外发布,其余端口不暴露)。

说明:deploy/config/application-iw.yml 与 application-ow.yml 按维护者
明确要求原样入库,其中含本机 Docker 用的库口令、RabbitMQ 口令与 JWT
密钥;上生产前需替换。
2026-11-02 10:59:03 +08:00

63 lines
3.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.
-- =============================================================
-- 升级脚本:机构上传配置(文件上传类型/大小限制)
-- 日期:2026-09-14
-- 说明:新增 x_upload_config 表(一行对应一个机构)。
-- 机构管理员可配置本机构允许上传的文件后缀白名单、
-- 单文件大小上限、上传总开关;未配置的机构默认允许全部。
-- 拦截点:网盘上传落库(normal_user_file/create)。
-- 执行方式:MySQL/达梦(DM8 MySQL兼容模式)执行第 1 节;
-- PostgreSQL 执行第 2 节。
-- =============================================================
-- -------------------------------------------------------------
-- 1. MySQL / 达梦 DM8
-- -------------------------------------------------------------
CREATE TABLE `x_upload_config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`org_id` bigint(20) DEFAULT NULL COMMENT '机构id',
`upload_enabled` bit(1) DEFAULT b'1' COMMENT '是否允许上传',
`allow_all_type` bit(1) DEFAULT b'1' COMMENT '是否允许全部类型(false时按allowed_suffixes白名单校验)',
`allowed_suffixes` varchar(1024) DEFAULT NULL COMMENT '允许的文件后缀(逗号分隔,小写),allow_all_type=false时生效',
`max_file_size` bigint(20) DEFAULT NULL COMMENT '单文件大小上限(MB),空或0不限制',
`deleted` bit(1) DEFAULT b'0' COMMENT '是否删除',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_org_id` (`org_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机构上传配置';
-- -------------------------------------------------------------
-- 2. PostgreSQL
-- -------------------------------------------------------------
CREATE TABLE x_upload_config (
id BIGSERIAL PRIMARY KEY,
org_id BIGINT DEFAULT NULL,
upload_enabled BOOLEAN DEFAULT TRUE,
allow_all_type BOOLEAN DEFAULT TRUE,
allowed_suffixes VARCHAR(1024) DEFAULT NULL,
max_file_size BIGINT DEFAULT NULL,
deleted BOOLEAN DEFAULT FALSE,
create_by BIGINT DEFAULT NULL,
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
update_by BIGINT DEFAULT NULL,
update_time TIMESTAMP DEFAULT NULL,
proxy_by BIGINT DEFAULT NULL,
CONSTRAINT uk_upload_config_org_id UNIQUE (org_id)
);
COMMENT ON TABLE x_upload_config IS '机构上传配置';
COMMENT ON COLUMN x_upload_config.id IS '主键ID';
COMMENT ON COLUMN x_upload_config.org_id IS '机构id';
COMMENT ON COLUMN x_upload_config.upload_enabled IS '是否允许上传';
COMMENT ON COLUMN x_upload_config.allow_all_type IS '是否允许全部类型(false时按allowed_suffixes白名单校验)';
COMMENT ON COLUMN x_upload_config.allowed_suffixes IS '允许的文件后缀(逗号分隔,小写),allow_all_type=false时生效';
COMMENT ON COLUMN x_upload_config.max_file_size IS '单文件大小上限(MB),空或0不限制';
COMMENT ON COLUMN x_upload_config.deleted IS '是否删除';
COMMENT ON COLUMN x_upload_config.create_by IS '创建人';
COMMENT ON COLUMN x_upload_config.create_time IS '创建时间';
COMMENT ON COLUMN x_upload_config.update_by IS '修改人';
COMMENT ON COLUMN x_upload_config.update_time IS '修改时间';
COMMENT ON COLUMN x_upload_config.proxy_by IS '代理人';