646 lines
70 KiB
XML
646 lines
70 KiB
XML
<mxfile host="drawio.ishenwei.online" agent="OpenCode">
|
||
<diagram name="Fonrey ER Diagram" id="fonrey-er-v1">
|
||
<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" />
|
||
<mxCell id="region-org" parent="1" style="swimlane;startSize=30;fillColor=#0d3349;strokeColor=#22d3ee;fontColor=#22d3ee;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" value="ORG / HR" vertex="1">
|
||
<mxGeometry height="760" width="380" x="-860" y="60" as="geometry">
|
||
<mxRectangle height="30" width="100" x="40" y="60" as="alternateBounds" />
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="org-units" parent="region-org" style="text;html=1;strokeColor=#22d3ee;fillColor=#0d3349;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>org_units</b>
<hr/>
🔑 PK id: uuid
parent_id: uuid (FK → self)
type: varchar(20)
name: varchar(100)
path: varchar(500) [物化路径]
depth: smallint
sort_order: int
is_active: bool
created_at: timestamptz
deleted_at: timestamptz" vertex="1">
|
||
<mxGeometry height="185" width="280" x="30" y="60" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="staff" parent="region-org" style="text;html=1;strokeColor=#22d3ee;fillColor=#0d3349;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>staff</b>
<hr/>
🔑 PK id: uuid
FK org_unit_id → org_units
name: varchar(50)
phone_enc: text [AES-256-GCM]
phone_hash: varchar(64) [SHA-256]
id_no_enc: text [AES]
user_id: uuid [FK → auth_user]
entry_date: date
status: active/resigned/...
is_active: bool
created_at: timestamptz
deleted_at: timestamptz" vertex="1">
|
||
<mxGeometry height="215" width="280" x="30" y="280" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-org-self" edge="1" parent="region-org" source="org-units" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.3;entryDx=0;entryDy=0;strokeColor=#22d3ee;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="org-units">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="340" y="153" />
|
||
<mxPoint x="340" y="108" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-org-self-lbl" connectable="0" parent="e-org-self" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" value="自引用 parent_id" vertex="1">
|
||
<mxGeometry relative="1" x="0.1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-org-staff" edge="1" parent="region-org" source="org-units" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#22d3ee;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="staff">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-org-staff-lbl" connectable="0" parent="e-org-staff" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="region-complex" parent="1" style="swimlane;startSize=30;fillColor=#063b2f;strokeColor=#34d399;fontColor=#34d399;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" value="REGION & COMPLEX" vertex="1">
|
||
<mxGeometry height="1830" width="1200" x="-440" y="60" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="districts" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>districts</b>
<hr/>
🔑 PK id: uuid
city: varchar(50)
name: varchar(50)
short_name: varchar(20)
sort_order: int
is_active: bool
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="150" width="280" x="50" y="60" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="business-areas" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>business_areas</b>
<hr/>
🔑 PK id: uuid
🔗 FK district_id → districts
name: varchar(100)
latitude: numeric(10,7)
longitude: numeric(10,7)
sort_order: int
is_active: bool" vertex="1">
|
||
<mxGeometry height="155" width="280" x="50" y="265" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="schools" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>schools</b>
<hr/>
🔑 PK id: uuid
🔗 FK district_id → districts
name: varchar(100)
type: primary/middle/high/k9/k12
nature: public/private/international
level: normal/key/top
is_active: bool" vertex="1">
|
||
<mxGeometry height="155" width="290" x="490" y="60" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="complexes" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>complexes</b>
<hr/>
🔑 PK id: uuid
🔗 FK district_id → districts
🔗 FK created_by → staff
name: varchar(200) [⚠ 不可直接修改]
address: varchar(500) [只读]
address_summary: varchar(100)
latitude: numeric(10,7)
longitude: numeric(10,7)
property_usage_types: varchar[]
building_structure: varchar(30)
building_type: slab/tower/slab_tower
land_use_years: varchar(30)
built_years: smallint[]
total_units: int
total_households: int
total_floor_area: numeric(12,2)
plot_area: numeric(12,2)
plot_ratio: numeric(5,2)
green_rate: numeric(5,2)
developer: varchar(200)
property_company: varchar(200)
property_fee: numeric(8,2)
property_phone: varchar(30)
parking_total: int
parking_underground: int
parking_ratio: varchar(20)
water_type: civil/commercial
electricity_type: civil/commercial
has_central_heating: bool
has_gas: bool
lock_building: bool
lock_room: bool
lock_info: bool
lock_standard_room: bool
search_vector: tsvector
remarks: text
is_active: bool
created_at: timestamptz
updated_at: timestamptz
deleted_at: timestamptz" vertex="1">
|
||
<mxGeometry height="570" width="340" x="30" y="660" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="complex-aliases" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>complex_aliases</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
alias: varchar(200)
is_system: bool [系统别名只读]
created_at: timestamptz
🔗 FK created_by → staff" vertex="1">
|
||
<mxGeometry height="130" width="290" x="475" y="450" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="complex-biz-areas" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#0a2e22;strokeWidth=1;dashed=1;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#6ee7b7;whiteSpace=pre;" value="<b>complex_business_areas</b> [N:M join]
<hr/>
🔗 FK complex_id → complexes
🔗 FK business_area_id → business_areas
is_primary: bool [UNIQUE where TRUE]" vertex="1">
|
||
<mxGeometry height="110" width="380" x="30" y="480" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="complex-schools" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#0a2e22;strokeWidth=1;dashed=1;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#6ee7b7;whiteSpace=pre;" value="<b>complex_schools</b> [N:M join]
<hr/>
🔗 FK complex_id → complexes
🔗 FK school_id → schools
zone_type: guaranteed/reference/lottery" vertex="1">
|
||
<mxGeometry height="110" width="310" x="480" y="270" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="complex-price-trends" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>complex_price_trends</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
record_month: date [存月份1日]
avg_sale_price: numeric(12,2)
avg_unit_price: numeric(10,2)
transaction_count: int
listing_count: int
created_at: timestamptz
UNIQUE(complex_id, record_month)" vertex="1">
|
||
<mxGeometry height="185" width="380" x="500" y="980" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="complex-photos" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>complex_photos</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
category: complex/layout/vr/other
file_key: text [R2/S3]
thumbnail_key: text
file_name: varchar(255)
file_size: int
width, height: int
is_cover: bool [UNIQUE where TRUE]
sort_order: smallint
created_at: timestamptz
🔗 FK created_by → staff" vertex="1">
|
||
<mxGeometry height="205" width="300" x="470" y="650" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-dist-biz" edge="1" parent="region-complex" source="districts" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="business-areas">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-dist-biz-lbl" connectable="0" parent="e-dist-biz" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-dist-school" edge="1" parent="region-complex" source="districts" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="schools">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-dist-school-lbl" connectable="0" parent="e-dist-school" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-dist-complex" edge="1" parent="region-complex" source="districts" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="complexes">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-dist-complex-lbl" connectable="0" parent="e-dist-complex" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-biz-join" edge="1" parent="region-complex" source="business-areas" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" target="complex-biz-areas">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-join-complex" edge="1" parent="region-complex" source="complex-biz-areas" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" target="complexes">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-school-join" edge="1" parent="region-complex" source="schools" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" target="complex-schools">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-school-join2" edge="1" parent="region-complex" source="complex-schools" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" target="complexes">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="420" y="325" />
|
||
<mxPoint x="420" y="690" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-complex-alias" edge="1" parent="region-complex" source="complexes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="complex-aliases">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="820" y="945" />
|
||
<mxPoint x="820" y="515" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-complex-alias-lbl" connectable="0" parent="e-complex-alias" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-complex-photos" edge="1" parent="region-complex" source="complexes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="complex-photos">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-complex-photos-lbl" connectable="0" parent="e-complex-photos" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-complex-trend" edge="1" parent="region-complex" source="complexes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="complex-price-trends">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="400" y="1072" />
|
||
<mxPoint x="400" y="1072" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-complex-trend-lbl" connectable="0" parent="e-complex-trend" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="room-units" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>room_units</b>
<hr/>
🔑 PK id: uuid
🔗 FK building_id → buildings
floor: smallint
floor_name: varchar(20)
room_no: varchar(30)
display_no: varchar(50)
is_standard: bool
is_active: bool
created_at: timestamptz
updated_at: timestamptz
UNIQUE(building_id, floor, room_no)" vertex="1">
|
||
<mxGeometry height="200" width="310" x="860" y="1402.5" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="metro-lines" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>metro_lines</b>
<hr/>
🔑 PK id: uuid
city: varchar(50)
name: varchar(50)
color: varchar(7) [HEX]
sort_order: int
is_active: bool" vertex="1">
|
||
<mxGeometry height="130" width="260" x="10" y="1680" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="metro-stations" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>metro_stations</b>
<hr/>
🔑 PK id: uuid
🔗 FK metro_line_id → metro_lines
name: varchar(50)
latitude: numeric(10,7)
longitude: numeric(10,7)
sort_order: int
is_active: bool" vertex="1">
|
||
<mxGeometry height="150" width="280" x="300" y="1670" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-metro-line-station" edge="1" parent="region-complex" source="metro-lines" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="metro-stations">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-metro-lbl" connectable="0" parent="e-metro-line-station" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="complex-metro-stations" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#0a2e22;strokeWidth=1;dashed=1;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#6ee7b7;whiteSpace=pre;" value="<b>complex_metro_stations</b> [N:M join]
<hr/>
🔗 FK complex_id → complexes
🔗 FK station_id → metro_stations
distance_meters: int [步行距离]" vertex="1">
|
||
<mxGeometry height="130" width="330" x="10" y="1520" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-metro-join1" edge="1" parent="region-complex" source="metro-stations" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" target="complex-metro-stations">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-metro-join2" edge="1" parent="region-complex" source="complex-metro-stations" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" target="complexes">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="buildings" parent="region-complex" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>buildings</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
🔗 FK school_id → schools [楼栋级学区]
name: varchar(50)
is_standard: bool
property_usage_type: varchar(20)
built_year: smallint
total_floors: smallint
land_use_years: varchar(30)
has_elevator: bool
is_active: bool
created_at: timestamptz
🔗 FK created_by → staff" vertex="1">
|
||
<mxGeometry height="225" width="310" x="500" y="1390" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-bldg-room" edge="1" parent="region-complex" source="buildings" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="room-units">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-bldg-room-lbl" connectable="0" parent="e-bldg-room" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-complex-bldg" edge="1" parent="region-complex" source="complexes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="buildings">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="270" y="1502" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-complex-bldg-lbl" connectable="0" parent="e-complex-bldg" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="region-property" parent="1" style="swimlane;startSize=30;fillColor=#2d1a5e;strokeColor=#a78bfa;fontColor=#a78bfa;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" value="PROPERTY" vertex="1">
|
||
<mxGeometry height="1700" width="1380" x="800" y="60" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="properties" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>properties</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
🔗 FK building_id → buildings
🔗 FK room_unit_id → room_units
🔗 FK agent_id → staff
listing_type: sale/rent/both
status: varchar(20)
sale_price: numeric(12,2) [万元]
rent_price: numeric(10,2) [元/月]
area: numeric(8,2) [m²]
floor: smallint
total_floors: smallint
bedroom: smallint
living_room: smallint
bathroom: smallint
orientation: varchar(30)
decoration: varchar(20)
has_elevator: bool
built_year: smallint
ownership_years: varchar(20)
is_exclusive: bool [独家委托]
completeness_score: int
search_vector: tsvector
source: varchar(30)
remarks: text
created_at: timestamptz
updated_at: timestamptz
deleted_at: timestamptz
🔗 FK created_by → staff
🔗 FK updated_by → staff
<i>[89,000+ rows · 复合索引 · 分区预留]</i>" vertex="1">
|
||
<mxGeometry height="560" width="380" x="30" y="60" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-contacts" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_contacts</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
name: varchar(50)
phone_enc: text [AES-256-GCM]
phone_hash: varchar(64) [SHA-256]
role: owner/agent/tenant
is_primary: bool
created_at: timestamptz
deleted_at: timestamptz" vertex="1">
|
||
<mxGeometry height="170" width="310" x="460" y="350" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-follow-logs" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_follow_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
🔗 FK staff_id → staff
log_type: call/visit/price_change/note/...
content: text
phone_no_viewed: bool [敏感操作]
created_at: timestamptz
🔗 FK created_by → staff
⚠ NO DELETE — append-only audit log" vertex="1">
|
||
<mxGeometry height="185" width="380" x="980" y="50" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="listing-histories" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>listing_histories</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
listed_at: timestamptz
delisted_at: timestamptz
list_price: numeric(12,2)
reason: varchar(50)
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="155" width="310" x="980" y="250" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-photos" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_photos</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
category: listing/vr/layout/other
file_key: text [R2/S3]
thumbnail_key: text
is_cover: bool
sort_order: smallint
width, height: int
file_size: int
created_at: timestamptz
🔗 FK created_by → staff" vertex="1">
|
||
<mxGeometry height="205" width="310" x="30" y="740" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-keys" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_keys</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
🔗 FK holder_id → staff
key_no: varchar(50)
status: held/returned
taken_at: timestamptz
returned_at: timestamptz
notes: text" vertex="1">
|
||
<mxGeometry height="165" width="310" x="980" y="430" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-commissions" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_commissions</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
commission_type: exclusive/open
rate: numeric(5,4)
amount: numeric(12,2)
start_date: date
end_date: date
signed_at: timestamptz
document_key: text
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="185" width="330" x="980" y="620" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-inspections" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_inspections</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
🔗 FK staff_id → staff
inspected_at: timestamptz
status: pending/done/cancelled
notes: text
attachments: jsonb
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="165" width="320" x="450" y="575" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-marketing" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_marketing</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties [UNIQUE 1:1]
title: varchar(200)
highlights: text[]
description: text
tags: varchar[]
platforms: jsonb
published_at: timestamptz
updated_at: timestamptz" vertex="1">
|
||
<mxGeometry height="175" width="340" x="980" y="870" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="property-certificates" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>property_certificates</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties [UNIQUE 1:1]
cert_no: varchar(50)
owner_name: varchar(100)
ownership_type: varchar(30)
area_registered: numeric(8,2)
issue_date: date
document_key: text" vertex="1">
|
||
<mxGeometry height="165" width="330" x="450" y="790" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="completeness-scores" parent="region-property" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" value="<b>completeness_scores</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties [UNIQUE 1:1]
score: int [0-100]
missing_fields: text[]
calculated_at: timestamptz
version: int" vertex="1">
|
||
<mxGeometry height="135" width="310" x="980" y="1090" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-contact" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="property-contacts">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="435" y="280" />
|
||
<mxPoint x="435" y="435" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-contact-lbl" connectable="0" parent="e-prop-contact" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-follow" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="property-follow-logs">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="840" y="80" />
|
||
<mxPoint x="840" y="80" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-follow-lbl" connectable="0" parent="e-prop-follow" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-listing" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="listing-histories">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="960" y="110" />
|
||
<mxPoint x="960" y="328" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-listing-lbl" connectable="0" parent="e-prop-listing" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-photos" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="property-photos">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="50" y="672" />
|
||
<mxPoint x="50" y="672" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-photos-lbl" connectable="0" parent="e-prop-photos" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-keys" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="property-keys">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="920" y="140" />
|
||
<mxPoint x="920" y="512" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-keys-lbl" connectable="0" parent="e-prop-keys" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-comm" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="property-commissions">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="880" y="180" />
|
||
<mxPoint x="880" y="712" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-comm-lbl" connectable="0" parent="e-prop-comm" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-insp" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="property-inspections">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="440" y="500" />
|
||
<mxPoint x="440" y="680" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-insp-lbl" connectable="0" parent="e-prop-insp" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-marketing" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERone;startArrow=ERone;fontSize=9;" target="property-marketing">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="830" y="220" />
|
||
<mxPoint x="830" y="958" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-marketing-lbl" connectable="0" parent="e-prop-marketing" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:1" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-cert" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERone;startArrow=ERone;fontSize=9;" target="property-certificates">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="290" y="670" />
|
||
<mxPoint x="410" y="670" />
|
||
<mxPoint x="410" y="872" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-cert-lbl" connectable="0" parent="e-prop-cert" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:1" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-score" edge="1" parent="region-property" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERone;startArrow=ERone;fontSize=9;" target="completeness-scores">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="790" y="260" />
|
||
<mxPoint x="790" y="1158" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-score-lbl" connectable="0" parent="e-prop-score" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:1" vertex="1">
|
||
<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="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" />
|
||
</mxCell>
|
||
<mxCell id="client-requirements" 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>client_requirements</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
req_type: second_hand/new/rent
district_ids: uuid[]
business_area_ids: uuid[]
price_min: numeric
price_max: numeric
area_min: numeric
area_max: numeric
bedrooms: int[]
school_ids: uuid[]
has_elevator: bool
is_active: bool
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="260" width="350" x="40" y="507.5" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="client-follow-logs" 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>client_follow_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
🔗 FK staff_id → staff
log_type: call/visit/match/note/status_change
content: text
next_follow_date: date
created_at: timestamptz
🔗 FK created_by → staff
⚠ NO DELETE — append-only audit log" vertex="1">
|
||
<mxGeometry height="200" width="380" x="660" y="50" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="client-viewings" 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>client_viewings</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
🔗 FK property_id → properties
🔗 FK agent_id → staff
viewed_at: timestamptz
feedback: text
rating: smallint [1-5]
status: planned/done/cancelled
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="195" width="360" x="660" y="310" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="client-matches" 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>client_property_matches</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
🔗 FK property_id → properties
🔗 FK agent_id → staff
match_type: system/manual
score: numeric(5,2)
status: pending/sent/viewed/dismissed
sent_at: timestamptz
viewed_at: timestamptz
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="205" width="380" x="30" y="800" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="client-status-logs" 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>client_status_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
from_status: varchar(20)
to_status: varchar(20)
transfer_type: auto/manual
reason: text
created_at: timestamptz
🔗 FK created_by → staff
⚠ NO DELETE — append-only audit log" vertex="1">
|
||
<mxGeometry height="195" width="370" x="655" y="540" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="client-fav-folders" 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>client_favorite_folders</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
name: varchar(100)
sort_order: int
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="130" width="300" x="655" y="980" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="client-folder-items" 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>client_folder_items</b>
<hr/>
🔑 PK id: uuid
🔗 FK folder_id → client_favorite_folders
🔗 FK property_id → properties
sort_order: int
created_at: timestamptz" vertex="1">
|
||
<mxGeometry height="130" width="320" x="655" y="780" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-client-req" edge="1" parent="region-client" source="clients" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-requirements">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="290" y="460" />
|
||
<mxPoint x="290" y="460" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-client-req-lbl" connectable="0" parent="e-client-req" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-client-follow" edge="1" parent="region-client" source="clients" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-follow-logs">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="600" y="80" />
|
||
<mxPoint x="600" y="80" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-client-follow-lbl" connectable="0" parent="e-client-follow" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-client-viewing" edge="1" parent="region-client" source="clients" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-viewings">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="640" y="110" />
|
||
<mxPoint x="640" y="408" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-client-viewing-lbl" connectable="0" parent="e-client-viewing" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-client-match" edge="1" parent="region-client" source="clients" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-matches">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="440" y="300" />
|
||
<mxPoint x="440" y="902" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-client-match-lbl" connectable="0" parent="e-client-match" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-client-statuslog" edge="1" parent="region-client" source="clients" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-status-logs">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="620" y="140" />
|
||
<mxPoint x="620" y="638" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-client-statuslog-lbl" connectable="0" parent="e-client-statuslog" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-client-fav" edge="1" parent="region-client" source="clients" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-fav-folders">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="530" y="170" />
|
||
<mxPoint x="530" y="1045" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-client-fav-lbl" connectable="0" parent="e-client-fav" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-fav-items" edge="1" parent="region-client" source="client-fav-folders" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-folder-items">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-fav-items-lbl" connectable="0" parent="e-fav-items" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" value="1:N" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-complex-prop" edge="1" parent="1" source="complexes" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#a78bfa;dashed=0;endArrow=ERmany;startArrow=ERone;fontSize=9;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" target="properties">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-complex-prop-lbl" connectable="0" parent="e-complex-prop" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N complex_id" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-bldg-prop" edge="1" parent="1" source="buildings" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#a78bfa;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="properties">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="215" y="1390" />
|
||
<mxPoint x="1020" y="1390" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-bldg-prop-lbl" connectable="0" parent="e-bldg-prop" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N building_id" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-room-prop" edge="1" parent="1" source="room-units" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#a78bfa;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="properties">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="575" y="1710" />
|
||
<mxPoint x="1060" y="1710" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-room-prop-lbl" connectable="0" parent="e-room-prop" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" value="1:N room_unit_id" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-staff-prop" edge="1" parent="1" source="staff" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#22d3ee;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="properties">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="-530" y="448" />
|
||
<mxPoint x="-530" y="300" />
|
||
<mxPoint x="380" y="300" />
|
||
<mxPoint x="380" y="400" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-staff-prop-lbl" connectable="0" parent="e-staff-prop" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" value="agent_id" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-staff-client" edge="1" parent="1" source="staff" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#22d3ee;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="clients">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="700" y="490" />
|
||
<mxPoint x="700" y="300" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-staff-client-lbl" connectable="0" parent="e-staff-client" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" value="agent_id" vertex="1">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<mxCell id="e-prop-viewing" edge="1" parent="1" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#fb923c;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-viewings">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="2340" y="530" />
|
||
<mxPoint x="2340" y="530" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-viewing-lbl" connectable="0" parent="e-prop-viewing" 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>
|
||
<mxCell id="e-prop-match" edge="1" parent="1" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#fb923c;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-matches">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="2690" y="400" />
|
||
<mxPoint x="2690" y="990" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<mxCell id="e-prop-match-lbl" connectable="0" parent="e-prop-match" 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>
|
||
<mxCell id="e-prop-folder" edge="1" parent="1" source="properties" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#fb923c;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" target="client-folder-items">
|
||
<mxGeometry relative="1" as="geometry">
|
||
<Array as="points">
|
||
<mxPoint x="2800" y="310" />
|
||
<mxPoint x="2800" y="905" />
|
||
</Array>
|
||
</mxGeometry>
|
||
</mxCell>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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>
|
||
<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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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" />
|
||
<mxPoint x="320" y="288" />
|
||
</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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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" />
|
||
<mxPoint x="905" y="315" />
|
||
</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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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" />
|
||
<mxPoint x="755" y="363" />
|
||
</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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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" />
|
||
<mxPoint x="1642" y="430" />
|
||
<mxPoint x="1642" y="248" />
|
||
</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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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" />
|
||
<mxPoint x="1642" y="480" />
|
||
<mxPoint x="1642" y="395" />
|
||
</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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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" />
|
||
<mxPoint x="1342" y="520" />
|
||
<mxPoint x="1342" y="408" />
|
||
</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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
<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" />
|
||
<mxPoint x="1775" y="392" />
|
||
</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">
|
||
<mxGeometry relative="1" as="geometry" />
|
||
</mxCell>
|
||
</root>
|
||
</mxGraphModel>
|
||
</diagram>
|
||
</mxfile>
|