diray
Tables (15)
badges
- id — INT — Primary key — NOT NULL
- badge_type — VARCHAR(50) — NOT NULL
- name — VARCHAR(50) — NOT NULL
- description — VARCHAR(200)
- icon — VARCHAR(255)
- requirement — VARCHAR(255)
cloud_growth_logs
- id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- previous_stage — INT — NOT NULL
- new_stage — INT — NOT NULL
- growth_reason — VARCHAR(255)
- growth_percentage — DECIMAL(5,2) — NOT NULL
- createdAt — DATETIME — NOT NULL
- INDEX — `user_id`
comments
- id — INT — Primary key — NOT NULL
- diary_id — INT — Foreign key → diaries.id — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- content — TEXT — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `diary_id`
- INDEX — `user_id`
diaries
- id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- title — VARCHAR(100) — NOT NULL
- content — TEXT — NOT NULL
- is_public — TINYINT(1) — NOT NULL
- suggested_emotion_id — INT — Foreign key → emotions.id
- emotion_id — INT — Foreign key → emotions.id
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `user_id`
- INDEX — `suggested_emotion_id`
- INDEX — `emotion_id`
diary_tags
- diary_id — INT — Foreign key → diaries.id — NOT NULL
- tag_id — INT — Foreign key → tags.id — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `tag_id`
emotion_networks
- id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- time_period — ENUM('week', 'month', 'quarter', 'year', 'all') — NOT NULL
- emotion_data — JSON — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `user_id`
emotions
- id — INT — Primary key — NOT NULL
- name — VARCHAR(30) — NOT NULL
- description — VARCHAR(200)
- color — VARCHAR(20)
- icon — VARCHAR(300)
- icon_stage_1 — VARCHAR(300)
- icon_stage_2 — VARCHAR(300)
- icon_stage_3 — VARCHAR(300)
- icon_stage_4 — VARCHAR(300)
- icon_stage_5 — VARCHAR(300)
follows
- following_id — INT — Foreign key → users.id — NOT NULL
- follower_id — INT — Foreign key → users.id — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `follower_id`
likes
- id — INT — Primary key — NOT NULL
- diary_id — INT — Foreign key → diaries.id — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `diary_id`
- INDEX — `user_id`
notifications
- id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- sender_id — INT — Foreign key → users.id
- type — ENUM('comment', 'like', 'follow', 'growth', 'badge') — NOT NULL
- reference_id — INT
- message — VARCHAR(255) — NOT NULL
- is_read — TINYINT(1) — NOT NULL
- createdAt — DATETIME — NOT NULL
- INDEX — `user_id`
- INDEX — `sender_id`
tags
- id — INT — Primary key — NOT NULL
- name — VARCHAR(50) — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
user_badge
- user_id — INT — Foreign key → users.id — NOT NULL
- BadgeId — INT — Foreign key → badges.id — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `BadgeId`
user_badges
- badge_id — INT — Foreign key → badges.id — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `user_id`
user_emotion_clouds
- id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- growth_stage — INT — NOT NULL
- growth_percentage — DECIMAL(5,2) — NOT NULL
- last_growth_date — DATETIME
- streak_count — INT — NOT NULL
- longest_streak — INT — NOT NULL
- total_diaries — INT — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — `user_id`
users
- id — INT — Primary key — NOT NULL
- uid — VARCHAR(100) — NOT NULL
- upw — VARCHAR(200) — NOT NULL
- email — VARCHAR(100)
- name — VARCHAR(30) — NOT NULL
- profile_image — VARCHAR(255)
- bio — VARCHAR(300)
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL