@@ -65,47 +65,47 @@ The relationships between these entities are depicted as follows:
65
65
* Many authorizations can be associated with one bucket (` Many [Authorizations] to One [Bucket] ` ).
66
66
67
67
``` mermaid
68
- classDiagram
69
- class Users {
70
- +uuid user_id: primary_key, autogenerated, unique
71
- +string username: unique
72
- +string password_hash
73
- +timestamp created_at: autogenerated
68
+ erDiagram
69
+ Users ||--o{ API_Keys: has
70
+ Users }o--o{ Buckets: owns
71
+ Buckets ||--o{ Objects: contains
72
+ API_Keys ||--o{ Authorisations: specifies
73
+ Authorisations }o--|| Buckets: specifies
74
+
75
+ Users {
76
+ uuid user_id
77
+ string username
78
+ string password_hash
79
+ timestamp created_at
74
80
}
75
81
76
- class API_Keys {
77
- +int api_key_id: primary_key, autogenerated, unique
78
- +uuid user_id: foreign_key[Users]
79
- +string api_key_hash: unique
80
- +timestamp created_at: autogenerated
82
+ Buckets {
83
+ int bucket_id
84
+ string bucket_name
85
+ timestamp created_at
81
86
}
82
87
83
- class Buckets {
84
- +int bucket_id: primary_key, autogenerated, unique
85
- +string bucket_name: unique
86
- +timestamp created_at: autogenerated
88
+ API_Keys {
89
+ int api_key_id
90
+ uuid user_id
91
+ string api_key_hash
92
+ timestamp created_at
87
93
}
88
94
89
- class Objects {
90
- +int object_id: primary_key, autogenerated, unique
91
- +int bucket_id: foreign_key[Buckets]
92
- +int object_version
93
- +string object_key
94
- +bytes object_data
95
- +sha256 object_data_checksum
96
- +timestamp created_at: autogenerated
95
+ Authorisations {
96
+ int auth_id
97
+ int api_key_id
98
+ int bucket_id
99
+ timestamp created_at
97
100
}
98
101
99
- class Authorisations {
100
- +int auth_id: primary_key, autogenerated, unique
101
- +int api_key_id: foreign_key[API_Keys]
102
- +int bucket_id: foreign_key[Buckets]
103
- +timestamp created_at: autogenerated
102
+ Objects {
103
+ int object_id
104
+ int bucket_id
105
+ int object_version
106
+ string object_key
107
+ bytes object_data
108
+ sha256 object_data_checksum
109
+ timestamp created_at
104
110
}
105
-
106
- Users "1" <--> "N" API_Keys : "One [User] to Many [API_Keys]"
107
- Users "N" <--> "N" Buckets : "Many [Users] to Many [Buckets]"
108
- Buckets "1" <--> "N" Objects : "One [Bucket] to Many [Objects]"
109
- API_Keys "1" <--> "N" Authorisations : "One [API_Key] to Many [Authorizations]"
110
- Authorisations "N" <--> "1" Buckets : "Many [Authorization] to One [Bucket]"
111
111
```
0 commit comments