Skip to content

Commit f17644f

Browse files
committed
feat: updated diagram to ER
Signed-off-by: Mateusz Urbanek <[email protected]>
1 parent 7aad2ec commit f17644f

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

Diff for: docs/projects/s3gw/s3gw.md

+34-34
Original file line numberDiff line numberDiff line change
@@ -65,47 +65,47 @@ The relationships between these entities are depicted as follows:
6565
* Many authorizations can be associated with one bucket (`Many [Authorizations] to One [Bucket]`).
6666

6767
```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
7480
}
7581
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
8186
}
8287
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
8793
}
8894
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
97100
}
98101
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
104110
}
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]"
111111
```

0 commit comments

Comments
 (0)