Skip to content
Snippets Groups Projects
Commit c0d7e4e1 authored by Lorenzo BARBEY's avatar Lorenzo BARBEY
Browse files

Update file README.md

parent 7276c8f3
Branches
No related tags found
No related merge requests found
......@@ -4,42 +4,36 @@
```mermaid
---
title: Biblio4 Schema
title: Biblio4 Schema - Updated
---
erDiagram
USER ||--o{ COLLECTIONS : owns
USER ||--o{ COLLECTION : owns
USER {
string username PK
secret password_hash
string password
}
COLLECTIONS }o--o{ PHYSICAL_BOOK : are_composed_of
COLLECTIONS {
COLLECTION }o--o{ PHYSICAL_BOOK : are_composed_of
COLLECTION {
uuid id PK
bool isTheMainCollection
string name
string owner PK, FK
string user_id FK
}
USER ||--o{ ACCESS_KEYS : has
COLLECTIONS ||--o{ ACCESS_KEYS : has
ACCESS_KEYS {
USER ||--o{ SHARE_KEY : has
COLLECTION ||--o{ SHARE_KEY : has
SHARE_KEY {
uuid id PK
uuid collection_id PK, FK
string user_id PK, FK
rights rights
date expiration_date
}
BOOK {
string isbn PK
string title
date publication_date
string author
uuid user_id PK, FK
uuid[] collection_ids FK
string key_value
datetime expiration_date
enum permission_type
}
REVIEW }o--|| BOOK : review_of
REVIEW }o--|| USER : review_by
USER ||--o{ REVIEW : writes
BOOK ||--o{ REVIEW : has_reviews
REVIEW {
uuid id PK
string isbn PK, FK
uuid user_id PK, FK
string book_isbn FK
string username FK
bool read
int rating
string notes
......@@ -48,20 +42,18 @@ erDiagram
PHYSICAL_BOOK }o--|| BOOK : is_a
PHYSICAL_BOOK {
uuid id PK
any sticked_label
string isbn PK, FK
uuid[] collections_ids FK
string place_where_is_stored
string isbn FK
uuid user_id FK
string storage_location
}
PHYSICAL_BOOK ||--o{ LENDING : is_lended
USER ||--o{ LENDING : is_borrower
USER ||--o{ LENDING : is_lender
LENDING {
uuid id PK
uuid physical_book_id PK, FK
string borrower_id PK, FK
string lender_id PK, FK
date start_date
date end_date
PHYSICAL_BOOK ||--o{ COLLECTION : belongs_to
BOOK {
string isbn PK
string title
string author
string description
string publish_date
string image_url
int average_rating
}
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment