mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Split dbo schema into per-domain SQL schemas (#274)
This commit is contained in:
34
docs/web/diagrams/database-schema/social.mmd
Normal file
34
docs/web/diagrams/database-schema/social.mmd
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
---
|
||||
|
||||
erDiagram
|
||||
User ||--o| Profile : "has profile"
|
||||
User ||--o{ Follow : "follows"
|
||||
User ||--o{ Follow : "followed by"
|
||||
Profile ||--o{ Avatar : "has avatar history"
|
||||
|
||||
%% Cross-schema: defined in full in auth.mmd / media.mmd
|
||||
Avatar }o--|| Photo : "uses photo"
|
||||
|
||||
Profile {
|
||||
uniqueidentifier UserProfileID PK
|
||||
uniqueidentifier UserAccountID "FK, UK"
|
||||
nvarchar Biography
|
||||
}
|
||||
|
||||
Follow {
|
||||
uniqueidentifier UserFollowID PK
|
||||
uniqueidentifier UserAccountID FK
|
||||
uniqueidentifier FollowingID FK
|
||||
datetime CreatedAt
|
||||
}
|
||||
|
||||
Avatar {
|
||||
uniqueidentifier UserAvatarID PK
|
||||
uniqueidentifier UserProfileID FK
|
||||
uniqueidentifier PhotoID FK
|
||||
datetime2 ValidFrom
|
||||
datetime2 ValidTo "nullable; at most one row per UserProfileID has ValidTo IS NULL (active avatar)"
|
||||
}
|
||||
Reference in New Issue
Block a user