Lit-innosence / tus_yuurikai_system

MIT License
2 stars 0 forks source link

ER図-モデリング #5

Open Dot-P opened 3 months ago

Dot-P commented 3 months ago

目的

バックエンド開発に必要なオブジェクトの定義を行う。

Lit-innosence commented 3 months ago

ロッカー予約システム

erDiagram
Student ||--o{ StudentPair : ""
AssignmentRecord }o--|| Locker : ""
StudentPair ||--o{ AssignmentRecord : ""

Student {
    string student_id PK "学籍番号"
    string name "氏名"
    timestamp created_at
    timestamp updated_at
}

StudentPair {
    string pair_id PK   
    string student_id1 FK "学籍番号1"
    string student_id2 FK "学籍番号2"
    int year "年度"
    timestamp created_at
}

AssignmentRecord {
    string record_id PK
    string pair_id FK
    string locker_id FK
    int year "年度"
    timestamp created_at
    timestamp deleted_at
}

Locker {
    string locker_id PK
    string location
}

問題点

Dot-P commented 2 weeks ago

団体登録システム

erDiagram
    organization {
        uuid organization_id PK
        string organization_name
        string organization_ruby
        string organization_email
        timestamptz  created_at
        timestamptz  updated_at
    }

    registration {
        uuid organization_id PK
        int year PK
        string main_student_id FK
        string co_student_id FK
        string status_acceptance
        string status_authentication
        string status_form_confirmation
        string status_registration_complete
        timestamptz  created_at
        timestamptz  updated_at
    }

    representatives {
        string student_id PK
        string family_name
        string given_name
        string email
        string phone
        timestamptz  created_at
        timestamptz  updated_at
    }

    access_restrictions {
        timestamptz  start_time
        timestamptz  end_time
        timestamptz  updated_at
    }

    auth {
        uuid auth_id PK
        string main_auth_token 
        string co_auth_token 
        string phase
        timestamptz created_at
    }

    circle-auth-info {
        uuid auth_id PK
        string main_student_id FK
        string main_family_name
        string main_given_name
        string main_email
        string main_phone
        string co_student_id FK
        string co_family_name
        string co_given_name
        string co_email
        string co_phone
        string organization_name
        string organization_ruby
        string organization_email
        timestamptz created_at
    }

    registration }o--|| representatives: ""
    circle-auth-info ||--o{ representatives: ""
    organization ||--o{ registration: ""
    auth ||--|| circle-auth-info: ""

注意点

団体登録状況テーブルを作る予定であったが、更新頻度がorganization_nameと変わらないため同一に配置