Skip to content

Instantly share code, notes, and snippets.

@redfluz
Last active May 11, 2025 03:39
Show Gist options
  • Save redfluz/be6c41526d7780d183da35769977b610 to your computer and use it in GitHub Desktop.
Save redfluz/be6c41526d7780d183da35769977b610 to your computer and use it in GitHub Desktop.
erDiagram
    USER {
        int id PK
        int roleId FK
        string email
        string password
    }

    EMPLOYEE {
        int employeeId PK
        int userId FK
        int branchId FK
        string employeeName
        string employeePhone
        string employeeEmail
        string employeePosition
    }

    BRANCH {
        int branchId PK
        string branchName
    }

    ROLE {
        int roleId PK
        string roleName
    }

    ROLE_ACCESS {
        int roleAccessId PK
        int roleId FK
        string rolePage
        string roleAccessValue
    }

    LOGS {
        int logId PK
        int userId FK
        int authenticationTypeId FK
        datetime authenticationTimestamp
        float authenticationLatitude
        float authenticationLongitude
    }

    LOG_TYPE {
        int authenticationTypeId PK
        string logTypeName
    }

    USER ||--o{ EMPLOYEE : has
    BRANCH ||--o{ EMPLOYEE : has
    ROLE ||--o{ ROLE_ACCESS : grants
    USER ||--o{ LOGS : records
    LOG_TYPE ||--o{ LOGS : categorizes
    ROLE ||--o{ USER : assigned

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment