Files
starRiverProperty/docs/sql/tenant_visitor_floor_policy.sql
T
hpd840321 73dc34ec2c fix: update DDL policy_type DEFAULT from INTERSECT_ALLOWLIST to REPLACE_ALLOWLIST
- organization_tenant_visitor_floor_policy.sql: DEFAULT REPLACE_ALLOWLIST
- tenant_visitor_floor_policy.sql: @deprecated marker + DEFAULT fix
- Align DDL schema with V2 replacement semantics
2026-05-10 06:43:15 +08:00

31 lines
2.0 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.
-- @deprecated 2026-05-09: V2 策略仅在 component-organization 库维护 (organization_tenant_visitor_floor_policy.sql)
-- 此表为 V1 电梯侧遗留,V2 不再查询。保留仅供历史参考。
--
-- 租户访客默认楼层策略(电梯应用库 — 已废弃)
-- 设计说明:docs/business/租户访客默认楼层-数据库配置阶段技术设计.md
CREATE TABLE IF NOT EXISTS tenant_visitor_floor_policy (
id VARCHAR(32) NOT NULL COMMENT '主键',
business_id VARCHAR(64) NOT NULL COMMENT '机构/租户 ID',
policy_type VARCHAR(32) NOT NULL DEFAULT 'REPLACE_ALLOWLIST' COMMENT '策略类型(V2替代语义;V1曾用INTERSECT',
allow_zone_ids TEXT NULL COMMENT 'JSON 数组,zoneId 列表',
building_id VARCHAR(64) NULL COMMENT '预留:楼栋维度;租户默认填 NULL',
enabled TINYINT(1) NOT NULL DEFAULT 1 COMMENT '1 启用 0 停用',
policy_version BIGINT NOT NULL DEFAULT 1 COMMENT '配置版本号',
remark VARCHAR(256) NULL,
created_by VARCHAR(64) NULL,
created_at BIGINT NULL,
updated_by VARCHAR(64) NULL,
updated_at BIGINT NULL,
PRIMARY KEY (id),
UNIQUE KEY uk_biz_building (business_id, building_id),
KEY idx_business_enabled (business_id, enabled)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='租户访客默认楼层策略(@deprecated V2不再查询;策略改为组织库 REPLACE_ALLOWLIST 替代语义)';
-- 示例(实施时替换占位符后执行)— 已废弃,V2 请使用 organization_tenant_visitor_floor_policy_init_tenants.sql
-- INSERT INTO tenant_visitor_floor_policy
-- (id, business_id, policy_type, allow_zone_ids, building_id, enabled, policy_version, remark, created_at, updated_at)
-- VALUES
-- (REPLACE(UUID(),'-',''), 'REPLACE_WITH_BUSINESS_ID', 'REPLACE_ALLOWLIST',
-- '["REPLACE_ZONE_A","REPLACE_ZONE_B"]', NULL, 1, 1, '实施录入', UNIX_TIMESTAMP(NOW())*1000, UNIX_TIMESTAMP(NOW())*1000);