更新 ER diagram
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 901 KiB After Width: | Height: | Size: 1.2 MiB |
@@ -1,6 +1,6 @@
|
||||
<mxfile host="drawio.ishenwei.online" agent="OpenCode">
|
||||
<diagram name="Fonrey ER Diagram" id="fonrey-er-v1">
|
||||
<mxGraphModel dx="5097" dy="959" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="3300" pageHeight="2340" math="0" shadow="0">
|
||||
<mxGraphModel dx="9516" dy="5600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="3300" pageHeight="2340" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
@@ -316,7 +316,7 @@
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="region-client" parent="1" style="swimlane;startSize=30;fillColor=#3d1f06;strokeColor=#fbbf24;fontColor=#fbbf24;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" value="CLIENT" vertex="1">
|
||||
<mxGeometry height="1380" width="1060" x="2220" y="60" as="geometry" />
|
||||
<mxGeometry height="1380" width="1060" x="2280" y="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="clients" parent="region-client" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>clients</b>
<hr/>
🔑 PK id: uuid
🔗 FK agent_id → staff
client_type: private/public/closed
status: active/inactive/converted
name: varchar(50)
phone_enc: text [AES-256-GCM]
phone_hash: varchar(64) [SHA-256]
budget_min/max: numeric
activity_level: 1-5 [Celery每日计算]
is_protected: bool [防自动转公客]
transfer_to_public_type: auto/manual
last_follow_at: timestamptz
source: varchar(30)
remarks: text
created_at: timestamptz
deleted_at: timestamptz
🔗 FK created_by → staff
<i>[私客/公客/成交客 三态状态机]</i>" vertex="1">
|
||||
<mxGeometry height="360" width="370" x="30" y="60" as="geometry" />
|
||||
@@ -499,123 +499,55 @@
|
||||
<mxCell id="e-prop-folder-lbl" connectable="0" parent="e-prop-folder" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fb923c;" value="property_id" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
PUBLIC SCHEMA SWIMLANE(平台运营层)
|
||||
Color: slate-900 bg / cyan-400 accent (#0f172a / #22d3ee variant: #7dd3fc)
|
||||
Positioned ABOVE existing content at y=-1160
|
||||
════════════════════════════════════════════════════════════════ -->
|
||||
<mxCell id="region-public" parent="1"
|
||||
style="swimlane;startSize=36;fillColor=#0c1a2e;strokeColor=#7dd3fc;fontColor=#7dd3fc;fontSize=13;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=2;"
|
||||
value="PUBLIC SCHEMA(平台运营层)" vertex="1">
|
||||
<mxCell id="region-public" parent="1" style="swimlane;startSize=36;fillColor=#0c1a2e;strokeColor=#7dd3fc;fontColor=#7dd3fc;fontSize=13;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=2;" value="PUBLIC SCHEMA(平台运营层)" vertex="1">
|
||||
<mxGeometry height="560" width="3400" x="-860" y="-1200" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 1. tenants ── -->
|
||||
<mxCell id="pub-tenants" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.tenants</b>
<hr/>
🔑 PK id: uuid
schema_name: varchar(63) [UNIQUE, immutable]
name: varchar(255)
short_name: varchar(100)
contact_name / contact_email
region: varchar(100)
plan: basic/professional/enterprise
status: creating/active/suspended/
 pending_delete/deleted/failed
suspended_until: timestamptz
suspended_reason: varchar(50)
deleted_at: timestamptz
paid_until: date
on_trial: bool
is_canary: bool
created_at / updated_at: timestamptz
created_by: uuid
extra: jsonb" vertex="1">
|
||||
<mxCell id="pub-tenants" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.tenants</b>
<hr/>
🔑 PK id: uuid
schema_name: varchar(63) [UNIQUE, immutable]
name: varchar(255)
short_name: varchar(100)
contact_name / contact_email
region: varchar(100)
plan: basic/professional/enterprise
status: creating/active/suspended/
 pending_delete/deleted/failed
suspended_until: timestamptz
suspended_reason: varchar(50)
deleted_at: timestamptz
paid_until: date
on_trial: bool
is_canary: bool
created_at / updated_at: timestamptz
created_by: uuid
extra: jsonb" vertex="1">
|
||||
<mxGeometry height="310" width="290" x="30" y="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 2. domains ── -->
|
||||
<mxCell id="pub-domains" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.domains</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
domain: varchar(253) [UNIQUE]
is_primary: bool [UNIQUE partial]
created_at: timestamptz
⚠ domain 创建后不可修改" vertex="1">
|
||||
<mxCell id="pub-domains" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.domains</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
domain: varchar(253) [UNIQUE]
is_primary: bool [UNIQUE partial]
created_at: timestamptz
⚠ domain 创建后不可修改" vertex="1">
|
||||
<mxGeometry height="135" width="250" x="340" y="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 3. tenant_status_logs ── -->
|
||||
<mxCell id="pub-tenant-status-logs" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.tenant_status_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
from_status: varchar(20) [NULL=初始]
to_status: varchar(20)
reason: text
operator_id: uuid [NULL=Celery]
operator_name: varchar(100) [快照]
created_at: timestamptz
⚠ append-only — NO UPDATE/DELETE" vertex="1">
|
||||
<mxCell id="pub-tenant-status-logs" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.tenant_status_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
from_status: varchar(20) [NULL=初始]
to_status: varchar(20)
reason: text
operator_id: uuid [NULL=Celery]
operator_name: varchar(100) [快照]
created_at: timestamptz
⚠ append-only — NO UPDATE/DELETE" vertex="1">
|
||||
<mxGeometry height="175" width="270" x="340" y="200" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 4. platform_admins ── -->
|
||||
<mxCell id="pub-admins" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.platform_admins</b>
<hr/>
🔑 PK id: uuid
username: varchar(150) [UNIQUE]
email: varchar(254) [UNIQUE]
display_name: varchar(100)
password_hash: varchar(255)
role: super_admin/ops_operator/
 read_only_auditor
is_active: bool
mfa_enabled: bool [TOTP 确认后→TRUE]
last_login_at: timestamptz
created_at / updated_at: timestamptz
🔗 FK created_by → platform_admins" vertex="1">
|
||||
<mxCell id="pub-admins" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.platform_admins</b>
<hr/>
🔑 PK id: uuid
username: varchar(150) [UNIQUE]
email: varchar(254) [UNIQUE]
display_name: varchar(100)
password_hash: varchar(255)
role: super_admin/ops_operator/
 read_only_auditor
is_active: bool
mfa_enabled: bool [TOTP 确认后→TRUE]
last_login_at: timestamptz
created_at / updated_at: timestamptz
🔗 FK created_by → platform_admins" vertex="1">
|
||||
<mxGeometry height="225" width="270" x="640" y="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 5. admin_mfa_devices ── -->
|
||||
<mxCell id="pub-mfa" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.admin_mfa_devices</b>
<hr/>
🔑 PK id: uuid
🔗 FK admin_id → platform_admins
device_name: varchar(100)
totp_secret: varchar(255) [加密]
is_confirmed: bool
created_at: timestamptz
last_used_at: timestamptz" vertex="1">
|
||||
<mxCell id="pub-mfa" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.admin_mfa_devices</b>
<hr/>
🔑 PK id: uuid
🔗 FK admin_id → platform_admins
device_name: varchar(100)
totp_secret: varchar(255) [加密]
is_confirmed: bool
created_at: timestamptz
last_used_at: timestamptz" vertex="1">
|
||||
<mxGeometry height="150" width="250" x="930" y="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 6. admin_sessions ── -->
|
||||
<mxCell id="pub-sessions" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.admin_sessions</b>
<hr/>
🔑 PK id: uuid
🔗 FK admin_id → platform_admins
session_token: varchar(255) [UNIQUE]
ip_address: inet
user_agent: text
is_active: bool
created_at: timestamptz
expires_at: timestamptz [30min rolling]
revoked_at: timestamptz
🔗 FK revoked_by → platform_admins" vertex="1">
|
||||
<mxCell id="pub-sessions" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.admin_sessions</b>
<hr/>
🔑 PK id: uuid
🔗 FK admin_id → platform_admins
session_token: varchar(255) [UNIQUE]
ip_address: inet
user_agent: text
is_active: bool
created_at: timestamptz
expires_at: timestamptz [30min rolling]
revoked_at: timestamptz
🔗 FK revoked_by → platform_admins" vertex="1">
|
||||
<mxGeometry height="190" width="255" x="930" y="220" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 7. ip_whitelist ── -->
|
||||
<mxCell id="pub-ip" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.ip_whitelist</b>
<hr/>
🔑 PK id: uuid
cidr: cidr [如 203.0.113.0/24]
label: varchar(100)
is_active: bool
created_at: timestamptz
🔗 FK created_by → platform_admins" vertex="1">
|
||||
<mxCell id="pub-ip" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.ip_whitelist</b>
<hr/>
🔑 PK id: uuid
cidr: cidr [如 203.0.113.0/24]
label: varchar(100)
is_active: bool
created_at: timestamptz
🔗 FK created_by → platform_admins" vertex="1">
|
||||
<mxGeometry height="135" width="240" x="640" y="295" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 8. platform_audit_logs ── -->
|
||||
<mxCell id="pub-audit" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.platform_audit_logs</b>
<hr/>
🔑 PK id: uuid
operator_id: uuid [NULL=系统]
operator_name: varchar(100) [快照]
action_type: varchar(50)
target_type: varchar(30)
target_id / target_name: varchar
payload_summary: text
result: SUCCESS/FAILED
error_message: text
ip_address: inet
created_at: timestamptz
⚠ append-only — 建议月度 RANGE 分区" vertex="1">
|
||||
<mxCell id="pub-audit" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.platform_audit_logs</b>
<hr/>
🔑 PK id: uuid
operator_id: uuid [NULL=系统]
operator_name: varchar(100) [快照]
action_type: varchar(50)
target_type: varchar(30)
target_id / target_name: varchar
payload_summary: text
result: SUCCESS/FAILED
error_message: text
ip_address: inet
created_at: timestamptz
⚠ append-only — 建议月度 RANGE 分区" vertex="1">
|
||||
<mxGeometry height="225" width="265" x="1210" y="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 9. backup_schedules ── -->
|
||||
<mxCell id="pub-bk-schedules" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.backup_schedules</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants [NULL=全局]
frequency: hourly/daily/weekly
scheduled_time: time [UTC]
retention_count: int
storage_target: local/s3/r2/gcs
is_active: bool
created_at / updated_at: timestamptz
🔗 FK created_by → platform_admins
UNIQUE(tenant_id)" vertex="1">
|
||||
<mxCell id="pub-bk-schedules" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.backup_schedules</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants [NULL=全局]
frequency: hourly/daily/weekly
scheduled_time: time [UTC]
retention_count: int
storage_target: local/s3/r2/gcs
is_active: bool
created_at / updated_at: timestamptz
🔗 FK created_by → platform_admins
UNIQUE(tenant_id)" vertex="1">
|
||||
<mxGeometry height="195" width="265" x="1510" y="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 10. backup_records ── -->
|
||||
<mxCell id="pub-bk-records" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.backup_records</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
trigger_type: auto/manual/
 pre_upgrade/pre_restore
status: pending/in_progress/
 success/failed
storage_target / storage_path: text
size_bytes: bigint
started_at / completed_at
error_message: text
🔗 FK triggered_by → platform_admins
upgrade_event_id: uuid
created_at: timestamptz" vertex="1">
|
||||
<mxCell id="pub-bk-records" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.backup_records</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
trigger_type: auto/manual/
 pre_upgrade/pre_restore
status: pending/in_progress/
 success/failed
storage_target / storage_path: text
size_bytes: bigint
started_at / completed_at
error_message: text
🔗 FK triggered_by → platform_admins
upgrade_event_id: uuid
created_at: timestamptz" vertex="1">
|
||||
<mxGeometry height="245" width="265" x="1510" y="270" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 11. export_tasks ── -->
|
||||
<mxCell id="pub-exports" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.export_tasks</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
🔗 FK requested_by → platform_admins
modules: text[]
format: csv/json/sql_dump
status: pending/in_progress/done/failed
storage_path / download_url: text
expires_at: timestamptz [24h]
size_bytes: bigint
started_at / completed_at
created_at: timestamptz" vertex="1">
|
||||
<mxCell id="pub-exports" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.export_tasks</b>
<hr/>
🔑 PK id: uuid
🔗 FK tenant_id → tenants
🔗 FK requested_by → platform_admins
modules: text[]
format: csv/json/sql_dump
status: pending/in_progress/done/failed
storage_path / download_url: text
expires_at: timestamptz [24h]
size_bytes: bigint
started_at / completed_at
created_at: timestamptz" vertex="1">
|
||||
<mxGeometry height="215" width="265" x="1210" y="300" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 12. system_versions ── -->
|
||||
<mxCell id="pub-versions" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.system_versions</b>
<hr/>
🔑 PK id: uuid
version_number: varchar(50) [UNIQUE]
release_notes: text
artifact_url: text
status: current/previous/archived
 [UNIQUE partial: status='current']
released_at: timestamptz
🔗 FK created_by → platform_admins" vertex="1">
|
||||
<mxCell id="pub-versions" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.system_versions</b>
<hr/>
🔑 PK id: uuid
version_number: varchar(50) [UNIQUE]
release_notes: text
artifact_url: text
status: current/previous/archived
 [UNIQUE partial: status='current']
released_at: timestamptz
🔗 FK created_by → platform_admins" vertex="1">
|
||||
<mxGeometry height="165" width="265" x="1810" y="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── 13. upgrade_events ── -->
|
||||
<mxCell id="pub-upgrades" parent="region-public"
|
||||
style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;"
|
||||
value="<b>public.upgrade_events</b>
<hr/>
🔑 PK id: uuid
🔗 FK from_version_id → system_versions
🔗 FK to_version_id → system_versions
event_type: upgrade/rollback
strategy: full/canary
status: pending/health_check/
 in_progress/success/failed/rolled_back
tenant_progress: jsonb [{tenant,status,...}]
rollback_reason: text
incident_report: text
started_at / completed_at
🔗 FK initiated_by → platform_admins
created_at: timestamptz" vertex="1">
|
||||
<mxCell id="pub-upgrades" parent="region-public" style="text;html=1;strokeColor=#7dd3fc;fillColor=#0c1a2e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=10;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>public.upgrade_events</b>
<hr/>
🔑 PK id: uuid
🔗 FK from_version_id → system_versions
🔗 FK to_version_id → system_versions
event_type: upgrade/rollback
strategy: full/canary
status: pending/health_check/
 in_progress/success/failed/rolled_back
tenant_progress: jsonb [{tenant,status,...}]
rollback_reason: text
incident_report: text
started_at / completed_at
🔗 FK initiated_by → platform_admins
created_at: timestamptz" vertex="1">
|
||||
<mxGeometry height="255" width="280" x="1810" y="240" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- ── Internal edges (PUBLIC schema) ── -->
|
||||
<!-- tenants → domains -->
|
||||
<mxCell id="pe-tenant-domain" edge="1" parent="region-public" source="pub-tenants" target="pub-domains"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-tenant-domain" edge="1" parent="region-public" source="pub-tenants" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-domains">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="pe-tenant-domain-lbl" connectable="0" parent="pe-tenant-domain"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxCell id="pe-tenant-domain-lbl" connectable="0" parent="pe-tenant-domain" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- tenants → tenant_status_logs -->
|
||||
<mxCell id="pe-tenant-statuslog" edge="1" parent="region-public" source="pub-tenants" target="pub-tenant-status-logs"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-tenant-statuslog" edge="1" parent="region-public" source="pub-tenants" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-tenant-status-logs">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="320" y="295" />
|
||||
@@ -623,24 +555,16 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="pe-tenant-statuslog-lbl" connectable="0" parent="pe-tenant-statuslog"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N append-only" vertex="1">
|
||||
<mxCell id="pe-tenant-statuslog-lbl" connectable="0" parent="pe-tenant-statuslog" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N append-only" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- platform_admins → admin_mfa_devices -->
|
||||
<mxCell id="pe-admin-mfa" edge="1" parent="region-public" source="pub-admins" target="pub-mfa"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-admin-mfa" edge="1" parent="region-public" source="pub-admins" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-mfa">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="pe-admin-mfa-lbl" connectable="0" parent="pe-admin-mfa"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxCell id="pe-admin-mfa-lbl" connectable="0" parent="pe-admin-mfa" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- platform_admins → admin_sessions -->
|
||||
<mxCell id="pe-admin-session" edge="1" parent="region-public" source="pub-admins" target="pub-sessions"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-admin-session" edge="1" parent="region-public" source="pub-admins" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-sessions">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="905" y="235" />
|
||||
@@ -648,14 +572,10 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="pe-admin-session-lbl" connectable="0" parent="pe-admin-session"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxCell id="pe-admin-session-lbl" connectable="0" parent="pe-admin-session" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- platform_admins → ip_whitelist (created_by) -->
|
||||
<mxCell id="pe-admin-ip" edge="1" parent="region-public" source="pub-admins" target="pub-ip"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-admin-ip" edge="1" parent="region-public" source="pub-admins" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-ip">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="755" y="280" />
|
||||
@@ -663,14 +583,10 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="pe-admin-ip-lbl" connectable="0" parent="pe-admin-ip"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="created_by" vertex="1">
|
||||
<mxCell id="pe-admin-ip-lbl" connectable="0" parent="pe-admin-ip" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="created_by" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- tenants → backup_schedules -->
|
||||
<mxCell id="pe-tenant-bksched" edge="1" parent="region-public" source="pub-tenants" target="pub-bk-schedules"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-tenant-bksched" edge="1" parent="region-public" source="pub-tenants" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-bk-schedules">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="320" y="430" />
|
||||
@@ -679,14 +595,10 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="pe-tenant-bksched-lbl" connectable="0" parent="pe-tenant-bksched"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N (NULL=全局)" vertex="1">
|
||||
<mxCell id="pe-tenant-bksched-lbl" connectable="0" parent="pe-tenant-bksched" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N (NULL=全局)" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- tenants → backup_records -->
|
||||
<mxCell id="pe-tenant-bkrec" edge="1" parent="region-public" source="pub-tenants" target="pub-bk-records"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-tenant-bkrec" edge="1" parent="region-public" source="pub-tenants" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-bk-records">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="320" y="480" />
|
||||
@@ -695,14 +607,10 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="pe-tenant-bkrec-lbl" connectable="0" parent="pe-tenant-bkrec"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxCell id="pe-tenant-bkrec-lbl" connectable="0" parent="pe-tenant-bkrec" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- tenants → export_tasks -->
|
||||
<mxCell id="pe-tenant-export" edge="1" parent="region-public" source="pub-tenants" target="pub-exports"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-tenant-export" edge="1" parent="region-public" source="pub-tenants" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-exports">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="320" y="520" />
|
||||
@@ -711,24 +619,16 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="pe-tenant-export-lbl" connectable="0" parent="pe-tenant-export"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxCell id="pe-tenant-export-lbl" connectable="0" parent="pe-tenant-export" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="1:N" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- system_versions → upgrade_events (from/to) -->
|
||||
<mxCell id="pe-ver-upgrade" edge="1" parent="region-public" source="pub-versions" target="pub-upgrades"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-ver-upgrade" edge="1" parent="region-public" source="pub-versions" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-upgrades">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="pe-ver-upgrade-lbl" connectable="0" parent="pe-ver-upgrade"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="from/to version" vertex="1">
|
||||
<mxCell id="pe-ver-upgrade-lbl" connectable="0" parent="pe-ver-upgrade" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="from/to version" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- upgrade_events → backup_records (upgrade_event_id) -->
|
||||
<mxCell id="pe-upgrade-bkrec" edge="1" parent="region-public" source="pub-upgrades" target="pub-bk-records"
|
||||
style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;">
|
||||
<mxCell id="pe-upgrade-bkrec" edge="1" parent="region-public" source="pub-upgrades" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#7dd3fc;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="pub-bk-records">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="1808" y="392" />
|
||||
@@ -736,8 +636,7 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="pe-upgrade-bkrec-lbl" connectable="0" parent="pe-upgrade-bkrec"
|
||||
style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="upgrade_event_id" vertex="1">
|
||||
<mxCell id="pe-upgrade-bkrec-lbl" connectable="0" parent="pe-upgrade-bkrec" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#7dd3fc;" value="upgrade_event_id" vertex="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
|
||||
Reference in New Issue
Block a user