UMC ERD
Tables (11)
announcements
- announcement_id — BIGINT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- content — TEXT — NOT NULL
- published_at — DATETIME
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
book_hashtags
- book_id — BIGINT — Foreign key → books.book_id — NOT NULL
- hashtag_id — BIGINT — Foreign key → hashtags.hashtag_id — NOT NULL
book_likes
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- book_id — BIGINT — Foreign key → books.book_id — NOT NULL
- created_at — DATETIME — NOT NULL
books
- book_id — BIGINT — Primary key — NOT NULL
- category_id — BIGINT — Foreign key → categories.category_id — NOT NULL
- title — VARCHAR(255) — NOT NULL
- description — TEXT
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
categories
- category_id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
hashtags
- hashtag_id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(50) — NOT NULL
notification_settings
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- marketing_enabled — BOOLEAN — NOT NULL
- updated_at — DATETIME — NOT NULL
notifications
- notification_id — BIGINT — Primary key — NOT NULL
- notification_type — VARCHAR(30) — NOT NULL
- title — VARCHAR(255) — NOT NULL
- content — TEXT — NOT NULL
- rental_id — BIGINT
- announcement_id — BIGINT
- created_at — DATETIME — NOT NULL
- read_at — DATETIME
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
rentals
- rental_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- book_id — BIGINT — Foreign key → books.book_id — NOT NULL
- rented_at — DATETIME — NOT NULL
- due_at — DATETIME — NOT NULL
- returned_at — DATETIME
- status — VARCHAR(20) — NOT NULL
social_accounts
- social_account_id — BIGINT — Primary key — NOT NULL
- user_id (user_id2) — BIGINT — Foreign key → users.user_id — NOT NULL
- provider — VARCHAR(20) — NOT NULL
- provider_user_id — VARCHAR(100) — NOT NULL
- created_at — DATETIME — NOT NULL
users
- user_id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(50) — NOT NULL
- nickname — VARCHAR(50) — NOT NULL
- phone_number — VARCHAR(20) — NOT NULL
- gender — VARCHAR(20) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME