Files
2025-12-05 15:34:02 +08:00

51 lines
3.3 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.

CREATE SCHEMA IF NOT EXISTS config;
DROP TABLE IF EXISTS config.tb_sys_config CASCADE;
CREATE TABLE config.tb_sys_config (
optsn VARCHAR(50) NOT NULL, -- 流水号
config_id VARCHAR(50) NOT NULL, -- 配置ID
key VARCHAR(255) NOT NULL, -- 配置键
name VARCHAR(255) NOT NULL, -- 配置名称
value VARCHAR(255) NOT NULL, -- 配置值
config_type VARCHAR(50) NOT NULL, -- 数据类型(String, INTEGER, BOOLEAN, Float, Double)
render_type VARCHAR(50) NOT NULL, -- 配置渲染类型(select, input, textarea, checkbox, radio, switch)
description VARCHAR(255) NOT NULL, -- 配置描述
re JSON DEFAULT NULL, -- 正则表达式校验规则
options JSON DEFAULT NULL, -- 可选项render_type为select、checkbox、radio时使用
"group" VARCHAR(255) NOT NULL, -- 配置组
module_id VARCHAR(255) NOT NULL, -- 模块id
order_num INT NOT NULL, -- 配置顺序
status INT NOT NULL DEFAULT 0, -- 配置状态 0:启用 1:禁用
remark VARCHAR(255) NOT NULL, -- 配置备注
creator VARCHAR(50) DEFAULT NULL, -- 创建者
dept_path VARCHAR(255) DEFAULT NULL, -- 部门全路径支持like递归如/1/2/3/
updater VARCHAR(50) DEFAULT NULL, -- 更新者
create_time TIMESTAMPTZ NOT NULL DEFAULT now(), -- 配置创建时间
update_time TIMESTAMPTZ DEFAULT NULL, -- 配置更新时间
delete_time TIMESTAMPTZ DEFAULT NULL, -- 配置删除时间
deleted BOOLEAN NOT NULL DEFAULT false, -- 是否删除
PRIMARY KEY (config_id),
UNIQUE (optsn)
);
COMMENT ON TABLE config.tb_sys_config IS '系统配置表';
COMMENT ON COLUMN config.tb_sys_config.optsn IS '流水号';
COMMENT ON COLUMN config.tb_sys_config.config_id IS '配置ID';
COMMENT ON COLUMN config.tb_sys_config.key IS '配置键';
COMMENT ON COLUMN config.tb_sys_config.name IS '配置名称';
COMMENT ON COLUMN config.tb_sys_config.value IS '配置值';
COMMENT ON COLUMN config.tb_sys_config.config_type IS '数据类型';
COMMENT ON COLUMN config.tb_sys_config.render_type IS '数据渲染类型';
COMMENT ON COLUMN config.tb_sys_config.description IS '配置描述';
COMMENT ON COLUMN config.tb_sys_config.re IS '正则表达式校验规则';
COMMENT ON COLUMN config.tb_sys_config.options IS '可选项';
COMMENT ON COLUMN config.tb_sys_config.group IS'配置组名称';
COMMENT ON COLUMN config.tb_sys_config.module_id IS '模块id';
COMMENT ON COLUMN config.tb_sys_config.order_num IS '配置顺序';
COMMENT ON COLUMN config.tb_sys_config.status IS '配置状态';
COMMENT ON COLUMN config.tb_sys_config.remark IS '配置备注';
COMMENT ON COLUMN config.tb_sys_config.creator IS '创建者';
COMMENT ON COLUMN config.tb_sys_config.dept_path IS '部门全路径';
COMMENT ON COLUMN config.tb_sys_config.updater IS '更新者';
COMMENT ON COLUMN config.tb_sys_config.create_time IS '配置创建时间';
COMMENT ON COLUMN config.tb_sys_config.update_time IS '配置更新时间';
COMMENT ON COLUMN config.tb_sys_config.delete_time IS '配置删除时间';
COMMENT ON COLUMN config.tb_sys_config.deleted IS '是否删除';