Refactor ER diagram to add EventManager and update relations

Introduce the EventManager entity to improve role management, linking it between Users and Events. Adjust relationships among User, Event, and Guest, and refine EventTheme and User attributes. These changes enhance schema clarity and better represent user roles and permissions.
This commit is contained in:
2025-02-27 18:10:08 +01:00
parent 3ecf5fee2e
commit 0a6918c85b

View File

@@ -1,8 +1,10 @@
erDiagram
User ||--o{ Event : "creates/manages"
User ||--o{ Event : "creates"
User ||--o{ EventManager : "is assigned as"
User ||--o{ Guest : "can be linked to"
User {
uuid id PK
string email
string email UK
string password_hash
string first_name
string last_name
@@ -14,11 +16,28 @@ erDiagram
json preferences
}
EventManager }o--|| Event : "manages"
EventManager {
uuid id PK
uuid user_id FK
uuid event_id FK
string role
boolean can_edit
boolean can_invite
boolean can_manage_gifts
boolean can_send_updates
boolean can_view_analytics
datetime assigned_at
uuid assigned_by FK
datetime created_at
datetime updated_at
}
Event ||--o{ Guest : "invites"
Event ||--o{ GiftItem : "contains"
Event ||--o{ EventMedia : "has"
Event ||--o{ EventUpdate : "has"
Event ||--o{ EventTheme : "uses"
Event }o--|| EventTheme : "uses"
Event {
uuid id PK
string title
@@ -53,6 +72,7 @@ erDiagram
Guest {
uuid id PK
uuid event_id FK
uuid user_id FK "nullable"
string name
string email
string phone
@@ -235,3 +255,4 @@ erDiagram
Event ||--o{ RSVP : "receives"
Event ||--o{ EventActivity : "logs"
Event ||--o{ NotificationLog : "generates"
User ||--o{ EventManager : "has roles"