20260917212907
This commit is contained in:
1 parent
6fa3d8535e
commit
5cbf745bbf
115 files changed
+4104
-85
No files matched your search
@@ -205,6 +205,7 @@ create table dbo.s_relation (
|
||||
b_target_module_id varchar(50) not null, -- 目标模块
|
||||
b_target_field varchar(50) not null, -- 目标字段
|
||||
b_relation_type varchar(20) not null, -- one_to_one / one_to_many / many_to_one
|
||||
b_on_delete varchar(20) not null default 'none', -- 删除连带:none不连带 / cascade连带删除 / archive连带归档
|
||||
b_canuse tinyint not null default 1, -- 是否启用(0/1)
|
||||
b_xh int not null default 0, -- 显示顺序
|
||||
primary key (
|
||||
@@ -224,6 +225,36 @@ create index ix_s_relation_target
|
||||
on dbo.s_relation (b_target_module_id, b_canuse, b_source_module_id);
|
||||
GO
|
||||
|
||||
/* ============================================================================
|
||||
9.1 删除规则
|
||||
|
||||
挂在模块(业务条件:勾条件 / 写 SQL)或模块关系(存在引用即拒绝删除)上的删除前规则。
|
||||
规则类型不单独存列,由 b_predicate 推断:空=引用规则;JSON=勾条件;其余=SQL 文本。
|
||||
b_scope_id 是挂载对象的业务键:模块=模块编码;关系=源模块|源字段|目标模块|目标字段。
|
||||
主键用雪花 id(新增时前端取号,与业务表一致):规则没有天然业务键,也不要求 IT 填编码。
|
||||
============================================================================ */
|
||||
|
||||
create table dbo.s_rule (
|
||||
b_id bigint not null, -- 雪花主键(新增时前端经 /data/nextid 取号)
|
||||
b_scope_type varchar(20) not null, -- module / relation(挂载范围)
|
||||
b_scope_id varchar(250) not null, -- module=模块编码;relation=源模块|源字段|目标模块|目标字段
|
||||
b_hook varchar(30) not null, -- delete.pre(一期只做这个),save.pre 留位
|
||||
b_predicate nvarchar(max) null, -- 空=引用规则;JSON={"kind":"dsl","expr":…}=勾条件;其余=SQL 文本
|
||||
b_message nvarchar(500) null, -- 提示文案(写 SQL 必填;勾条件可空,引擎按条件自动生成)
|
||||
b_canuse tinyint not null default 1, -- 是否启用(0/1)
|
||||
b_xh int not null default 0, -- 执行顺序(并列按 b_xh、b_id)
|
||||
b_created_by varchar(50) null, -- 审计列由服务端维护,配置界面不提交
|
||||
b_created_at datetime2 null,
|
||||
b_updated_by varchar(50) null,
|
||||
b_updated_at datetime2 null,
|
||||
primary key (b_id)
|
||||
);
|
||||
GO
|
||||
|
||||
create index ix_s_rule_scope
|
||||
on dbo.s_rule (b_scope_type, b_scope_id, b_hook, b_canuse, b_xh);
|
||||
GO
|
||||
|
||||
/* ============================================================================
|
||||
10. 菜单
|
||||
============================================================================ */
|
||||
|
||||
Reference in new issue
Block a user