BookMind
Tables (12)
book
- id — BIGINT — Primary key — NOT NULL
- isbn — VARCHAR(20) — NOT NULL
- title — VARCHAR(255) — NOT NULL
- author — VARCHAR(100) — NOT NULL
- publisher — VARCHAR(100)
- published_date — DATE
- price — INT — NOT NULL
- description — TEXT
- cover_image_url — VARCHAR(500)
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
book_category
- book_id — BIGINT — Foreign key → book.id — NOT NULL
- category_id — BIGINT — Foreign key → category.id — NOT NULL
cart
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → member.id — NOT NULL
cart_item
- id — BIGINT — Primary key — NOT NULL
- cart_id — BIGINT — Foreign key → cart.id — NOT NULL
- book_id — BIGINT — Foreign key → book.id — NOT NULL
- quantity — INT — NOT NULL
category
- id — BIGINT — Primary key — NOT NULL
- parent_id — BIGINT — Foreign key → category.id
- name — VARCHAR(50) — NOT NULL
inventory
- id — BIGINT — Primary key — NOT NULL
- book_id — BIGINT — Foreign key → book.id — NOT NULL
- stock_quantity — INT — NOT NULL
- safety_stock — INT — NOT NULL
- updated_at — DATETIME — NOT NULL
member
- id — BIGINT — Primary key — NOT NULL
- email — VARCHAR(100) — NOT NULL
- password — VARCHAR(255) — NOT NULL
- name — VARCHAR(50) — NOT NULL
- phone — VARCHAR(20)
- role — ENUM — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
member_address
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → member.id — NOT NULL
- alias — VARCHAR(50)
- recipient_name — VARCHAR(50) — NOT NULL
- recipient_phone — VARCHAR(20) — NOT NULL
- zipcode — VARCHAR(10) — NOT NULL
- address — VARCHAR(255) — NOT NULL
- address_detail — VARCHAR(255)
- is_default — TINYINT(1) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
order_item
- id — BIGINT — Primary key — NOT NULL
- order_id — BIGINT — Foreign key → orders.id — NOT NULL
- book_id — BIGINT — Foreign key → book.id — NOT NULL
- quantity — INT — NOT NULL
- unit_price — INT — NOT NULL
orders
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → member.id — NOT NULL
- member_address_id — BIGINT — Foreign key → member_address.id
- order_number — VARCHAR(50) — NOT NULL
- total_price — INT — NOT NULL
- status — ENUM — NOT NULL
- recipient_name — VARCHAR(50) — NOT NULL
- recipient_phone — VARCHAR(20) — NOT NULL
- zipcode — VARCHAR(10) — NOT NULL
- delivery_address — VARCHAR(255) — NOT NULL
- address_detail — VARCHAR(255)
- ordered_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
payment
- id — BIGINT — Primary key — NOT NULL
- order_id — BIGINT — Foreign key → orders.id — NOT NULL
- payment_key — VARCHAR(100) — NOT NULL
- method — ENUM — NOT NULL
- amount — INT — NOT NULL
- status — ENUM — NOT NULL
- paid_at — DATETIME
review
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → member.id — NOT NULL
- book_id — BIGINT — Foreign key → book.id — NOT NULL
- order_item_id — BIGINT — Foreign key → order_item.id — NOT NULL
- rating — TINYINT — NOT NULL
- content — TEXT
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL