erDiagram
USER_TB {
bigint user_id PK
varchar username UK
varchar password
varchar name
varchar email
varchar profile_img_path
varchar role
varchar provider
varchar provider_id
datetime created_at
datetime updated_at
}
COMMUNITY_CATEGORY_TB {
bigint community_category_id PK
varchar community_category_name
}
COMMUNITY_TB {
bigint community_id PK
bigint community_category_id FK
bigint user_id FK
varchar community_title
longtext community_content
datetime created_at
bigint community_views
}
COMMUNITY_IMG_TB {
bigint community_img_id PK
bigint community_id FK
int seq
varchar img_path
}
COMMUNITY_COMMENT_TB {
bigint community_comment_id PK
bigint community_id FK
bigint parent_comment_id FK
bigint user_id FK
longtext content
datetime created_at
}
COMMUNITY_LIKE_TB {
bigint community_like_id PK
bigint community_id FK
bigint user_id FK
}
FOOD_CATEGORY_TB {
bigint food_category_id PK
varchar food_category_name
}
FOOD_TB {
bigint food_id PK
bigint food_category_id FK
bigint user_id FK
varchar food_title
longtext food_content
int food_price
varchar food_address
datetime created_at
}
FOOD_IMG_TB {
bigint food_img_id PK
bigint food_id FK
int seq
varchar img_path
}
FOOD_COMMENT_TB {
bigint food_comment_id PK
bigint food_id FK
bigint user_id FK
longtext content
datetime created_at
}
FOOD_COMMENT_IMG_TB {
bigint food_comment_img_id PK
bigint food_comment_id FK
int seq
varchar img_path
}
FOOD_COMMENT_LIKE_TB {
bigint food_comment_like_id PK
bigint food_comment_id FK
bigint user_id FK
}
FOOD_LIKE_TB {
bigint food_like_id PK
bigint food_id FK
bigint user_id FK
}
NOTICE_CATEGORY_TB {
bigint notice_category_id PK
varchar notice_category_name
}
NOTICE_TB {
bigint notice_id PK
bigint user_id FK
bigint notice_category_id FK
varchar notice_title
longtext notice_content
datetime created_at
bigint notice_views
}
NOTICE_IMG_TB {
bigint notice_img_id PK
bigint notice_id FK
int seq
varchar img_path
}
NOTICE_COMMENT_TB {
bigint notice_comment_id PK
bigint notice_id FK
bigint user_id FK
longtext content
datetime created_at
}
NOTICE_COMMENT_IMG_TB {
bigint notice_comment_img_id PK
bigint notice_comment_id FK
int seq
varchar img_path
}
NOTICE_LIKE_TB {
bigint notice_like_id PK
bigint notice_id FK
bigint user_id FK
}
MAP_INFO_CATEGORY_TB {
bigint map_info_category_id PK
varchar map_info_category_name
}
MAP_INFO_TB {
bigint map_info_id PK
varchar map_info_name
bigint map_info_category_id FK
varchar map_info_address
varchar map_info_phone_number
decimal map_info_lat
decimal map_info_lng
longtext map_info_operation_time
longtext map_info_break_time
tinyint map_info_full_time
tinyint map_info_special_animal
longtext map_info_content
}
%% Relationships
COMMUNITY_CATEGORY_TB ||--o{ COMMUNITY_TB : has
USER_TB ||--o{ COMMUNITY_TB : writes
COMMUNITY_TB ||--o{ COMMUNITY_IMG_TB : has
COMMUNITY_TB ||--o{ COMMUNITY_COMMENT_TB : has
COMMUNITY_COMMENT_TB ||--o{ COMMUNITY_COMMENT_TB : replies_to
USER_TB ||--o{ COMMUNITY_COMMENT_TB : writes
COMMUNITY_TB ||--o{ COMMUNITY_LIKE_TB : liked_by
USER_TB ||--o{ COMMUNITY_LIKE_TB : likes
FOOD_CATEGORY_TB ||--o{ FOOD_TB : has
USER_TB ||--o{ FOOD_TB : writes
FOOD_TB ||--o{ FOOD_IMG_TB : has
FOOD_TB ||--o{ FOOD_COMMENT_TB : has
USER_TB ||--o{ FOOD_COMMENT_TB : writes
FOOD_COMMENT_TB ||--o{ FOOD_COMMENT_IMG_TB : has
FOOD_COMMENT_TB ||--o{ FOOD_COMMENT_LIKE_TB : liked_by
USER_TB ||--o{ FOOD_COMMENT_LIKE_TB : likes
FOOD_TB ||--o{ FOOD_LIKE_TB : liked_by
USER_TB ||--o{ FOOD_LIKE_TB : likes
NOTICE_CATEGORY_TB ||--o{ NOTICE_TB : has
USER_TB ||--o{ NOTICE_TB : writes
NOTICE_TB ||--o{ NOTICE_IMG_TB : has
NOTICE_TB ||--o{ NOTICE_COMMENT_TB : has
USER_TB ||--o{ NOTICE_COMMENT_TB : writes
NOTICE_COMMENT_TB ||--o{ NOTICE_COMMENT_IMG_TB : has
NOTICE_TB ||--o{ NOTICE_LIKE_TB : liked_by
USER_TB ||--o{ NOTICE_LIKE_TB : likes
MAP_INFO_CATEGORY_TB ||--o{ MAP_INFO_TB : has
erDiagram
USER_TB {
bigint user_id PK
}
COMMUNITY_CATEGORY_TB {
bigint community_category_id PK
}
COMMUNITY_TB {
bigint community_id PK
bigint community_category_id FK
bigint user_id FK
}
COMMUNITY_IMG_TB {
bigint community_img_id PK
bigint community_id FK
}
COMMUNITY_COMMENT_TB {
bigint community_comment_id PK
bigint community_id FK
bigint parent_comment_id FK
bigint user_id FK
}
COMMUNITY_LIKE_TB {
bigint community_like_id PK
bigint community_id FK
bigint user_id FK
}
COMMUNITY_CATEGORY_TB ||--o{ COMMUNITY_TB : has
USER_TB ||--o{ COMMUNITY_TB : writes
COMMUNITY_TB ||--o{ COMMUNITY_IMG_TB : has
COMMUNITY_TB ||--o{ COMMUNITY_COMMENT_TB : has
COMMUNITY_COMMENT_TB ||--o{ COMMUNITY_COMMENT_TB : parent
USER_TB ||--o{ COMMUNITY_COMMENT_TB : writes
COMMUNITY_TB ||--o{ COMMUNITY_LIKE_TB : liked_by
USER_TB ||--o{ COMMUNITY_LIKE_TB : likes
erDiagram
EVENT {
integer event_id PK
varchar name
timestamptz start_time
timestamptz end_time
integer create_user_id
timestamptz create_date
integer last_mod_user_id
timestamptz last_mod_date
}
EVENT_LOG {
integer event_log_id PK
integer event_id FK
varchar type
text data
integer create_user_id
timestamptz create_date
}
QUESTION_TYPE {
varchar question_type_value PK
varchar name
text description
}
QUESTION {
integer question_id PK
text question
text options
text answer
text answer_value
varchar question_type_value FK
text explanation
integer points
varchar level_id
integer create_user_id
timestamptz create_date
integer last_mod_user_id
timestamptz last_mod_date
}
EVENT_QUESTION {
integer event_question_id PK
integer event_id FK
integer question_id FK
integer round_number
integer sequence
timestamptz start_timestamp
timestamptz close_timestamp
integer create_user_id
timestamptz create_date
}
SCHOOL {
integer school_id PK
varchar name
varchar mascot
varchar nickname
varchar city
varchar state_abbrev
integer create_user_id
timestamptz create_date
}
TEAM {
integer team_id PK
integer school_id FK
varchar name
varchar mascot
integer create_user_id
timestamptz create_date
integer last_mod_user_id
timestamptz last_mod_date
}
EVENT_TEAM {
integer event_id PK, FK
integer team_id PK, FK
integer create_user_id
timestamptz create_date
}
EVENT ||--o{ EVENT_QUESTION : contains
QUESTION ||--o{ EVENT_QUESTION : includes
QUESTION_TYPE ||--o{ QUESTION : categorizes
EVENT ||--o{ EVENT_LOG : logs
SCHOOL ||--o{ TEAM : has
EVENT ||--o{ EVENT_TEAM : includes
TEAM ||--o{ EVENT_TEAM : participates
