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:
@@ -1,8 +1,10 @@
|
|||||||
erDiagram
|
erDiagram
|
||||||
User ||--o{ Event : "creates/manages"
|
User ||--o{ Event : "creates"
|
||||||
|
User ||--o{ EventManager : "is assigned as"
|
||||||
|
User ||--o{ Guest : "can be linked to"
|
||||||
User {
|
User {
|
||||||
uuid id PK
|
uuid id PK
|
||||||
string email
|
string email UK
|
||||||
string password_hash
|
string password_hash
|
||||||
string first_name
|
string first_name
|
||||||
string last_name
|
string last_name
|
||||||
@@ -14,11 +16,28 @@ erDiagram
|
|||||||
json preferences
|
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{ Guest : "invites"
|
||||||
Event ||--o{ GiftItem : "contains"
|
Event ||--o{ GiftItem : "contains"
|
||||||
Event ||--o{ EventMedia : "has"
|
Event ||--o{ EventMedia : "has"
|
||||||
Event ||--o{ EventUpdate : "has"
|
Event ||--o{ EventUpdate : "has"
|
||||||
Event ||--o{ EventTheme : "uses"
|
Event }o--|| EventTheme : "uses"
|
||||||
Event {
|
Event {
|
||||||
uuid id PK
|
uuid id PK
|
||||||
string title
|
string title
|
||||||
@@ -53,6 +72,7 @@ erDiagram
|
|||||||
Guest {
|
Guest {
|
||||||
uuid id PK
|
uuid id PK
|
||||||
uuid event_id FK
|
uuid event_id FK
|
||||||
|
uuid user_id FK "nullable"
|
||||||
string name
|
string name
|
||||||
string email
|
string email
|
||||||
string phone
|
string phone
|
||||||
@@ -235,3 +255,4 @@ erDiagram
|
|||||||
Event ||--o{ RSVP : "receives"
|
Event ||--o{ RSVP : "receives"
|
||||||
Event ||--o{ EventActivity : "logs"
|
Event ||--o{ EventActivity : "logs"
|
||||||
Event ||--o{ NotificationLog : "generates"
|
Event ||--o{ NotificationLog : "generates"
|
||||||
|
User ||--o{ EventManager : "has roles"
|
||||||
|
|||||||
Reference in New Issue
Block a user