Skip to content

Commit

Permalink
separate user profile from user; names are unique keys
Browse files Browse the repository at this point in the history
  • Loading branch information
yoan committed Mar 19, 2024
1 parent 4c8c278 commit bc71edd
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions DB_Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
This is the structure of the database.
This structure only contains the basic elements needed for the main functions of the app.
It is expected to evolve in the development of the app.
- USER: a user of the app
- EVENT: an event created in the app, created by a user
- USER: a user of the app, metadata reference the attributes defined by https://supabase.com/docs/guides/auth/auth-user-management
- USER_PROFILE: information related to a user
- EVENT: an event created in the app, created by a user; the user has the choice to create the event for an association (host relation) or for himself
- TAG: a tag that can be linked to the user's preferences and the event's tags list
- ASSOCIATION: an association that has some committee members and followers, the committee members can create events for the association

## Diagram
```mermaid
erDiagram
USER_PROFILE {
string userId PK,FK
string name UK
}
USER {
string userId PK
string name
location location
string metadata
}
EVENT {
string eventId PK
Expand All @@ -26,21 +31,23 @@ erDiagram
}
TAG {
string tagId PK
string name
string name UK
}
ASSOCIATION {
string associationId PK
string name
string name UK
string description
}
USER }o--|| EVENT : organizer
USER }o--o{ EVENT: participant
USER }o--o{ TAG: interested
USER ||--|| USER_PROFILE: profile
EVENT }o--o{ TAG: tags
TAG }o--o{ TAG: subtag
ASSOCIATION }|--o{ USER: committee_member
ASSOCIATION }o--o{ USER: follower
ASSOCIATION }o--o{ EVENT: host
```
For mermaid syntax, see: https://mermaid.js.org/syntax/entityRelationshipDiagram.html

0 comments on commit bc71edd

Please sign in to comment.