Skip to content
Snippets Groups Projects
Commit 4b0e8ee6 authored by Eliaz's avatar Eliaz
Browse files

More complete Schema

parent 556504fb
No related branches found
No related tags found
No related merge requests found
......@@ -4,15 +4,56 @@
```mermaid
---
title: Biblio4 Schema Example
title: Biblio4 Schema
---
erDiagram
BOOK }o--|{ USER : read_by
USER ||--o{ COLLECTIONS : owns
USER {
string username PK
secret password_hash
}
COLLECTIONS }o--o{ PHYSICAL_BOOK : are_composed_of
COLLECTIONS {
uuid id PK
bool isTheMainCollection
string name
string owner PK, FK
}
USER ||--o{ ACCESS_KEYS : has
COLLECTIONS ||--o{ ACCESS_KEYS : has
ACCESS_KEYS {
uuid id PK
uuid collection_id PK, FK
string user_id PK, FK
rights rights
date expiration_date
}
BOOK {
string isbn PK
}
REVIEW }o--|| BOOK : review_of
REVIEW }o--|| USER : review_by
COLLECTIONS }o--o{ BOOK : are_composed_of
BOOK {
string isbn
REVIEW {
bool read
int rating
string notes
}
PHYSICAL_BOOK }o--|| BOOK : is_a
PHYSICAL_BOOK {
uuid id PK
any sticked_label
string isbn PK, FK
uuid[] collections_ids FK
}
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
}
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment