Skip to content
Snippets Groups Projects
B

biblio4

The project

Database schema

---
title: Biblio4 Schema
---
erDiagram
    USER ||--o{ COLLECTION : owns
    USER {
        string username PK
        string password
    }
    COLLECTION }o--o{ PHYSICAL_BOOK : are_composed_of
    COLLECTION {
        uuid id PK
        string name
        string user_id FK
    }
    USER ||--o{ SHARE_KEY : has
    COLLECTION ||--o{ SHARE_KEY : has
    SHARE_KEY {
        uuid id PK
        uuid user_id PK, FK
        uuid[] collection_ids FK
        string key_value
        datetime expiration_date
        enum permission_type
    }
    USER ||--o{ REVIEW : writes
    BOOK ||--o{ REVIEW : has_reviews
    REVIEW {
        uuid id PK
        string book_isbn FK
        string username FK
        bool read
        int rating
        string notes
        string tags
    }
    PHYSICAL_BOOK }o--|| BOOK : is_a
    PHYSICAL_BOOK {
        uuid id PK
        string isbn FK
        uuid user_id FK
        string storage_location
    }
    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
    }