Files
yunzerwebsiteallinone/go/docs/sql/alter_approval_binding_v2.sql
T
2026-11-16 17:22:50 +08:00

23 lines
1.2 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.
DROP TABLE IF EXISTS `yz_approval_binding`;
CREATE TABLE `yz_approval_binding` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`scope` TINYINT NOT NULL DEFAULT 1 COMMENT '1租户 2平台',
`tid` BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '租户ID(平台侧为0)',
`biz_type` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '功能/单据类型:reimburse/bid/domain',
`flow_id` BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '绑定的审批流ID',
`flow_code` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '审批流编号(冗余)',
`remark` VARCHAR(200) NOT NULL DEFAULT '' COMMENT '备注',
`is_deleted` TINYINT NOT NULL DEFAULT 0,
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_scope_tid_biz_flow` (`scope`,`tid`,`biz_type`,`flow_id`),
KEY `idx_flow` (`flow_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='审批流功能绑定(biz_type↔flow 多对多)';
ALTER TABLE `yz_backend_approval_flow`
ADD COLUMN `apply_dept_ids` VARCHAR(500) NOT NULL DEFAULT ''
COMMENT '适用部门ID列表 CSV,空=全公司通用' AFTER `flow_code`;