Final DB

Tables (11)

boards

  • board_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(256) — NOT NULL

comments

  • comment_id — BIGINT — Primary key — NOT NULL
  • parent_comment — BIGINT — Foreign key → comments.comment_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL
  • content — VARCHAR(512)
  • created_at — TIMESTAMP
  • is_deleted — TINYINT(1)

follow

  • id — BIGINT — Primary key — NOT NULL
  • follow_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • following_user_id — BIGINT — Foreign key → users.user_id — NOT NULL

goods

  • goods_id — INT — Primary key — NOT NULL
  • name — VARCHAR(64) — NOT NULL
  • description — VARCHAR(256) — NOT NULL
  • price — INT — NOT NULL
  • goods_image — VARCHAR(256)

my_goods

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • goods_id — INT — Foreign key → goods.goods_id — NOT NULL
  • amount — INT — NOT NULL

point_log

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • amount — INT — NOT NULL
  • description — VARCHAR(64)
  • time — TIMESTAMP

post_images

  • id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL
  • image_url — VARCHAR(512)

posts

  • post_id — BIGINT — Primary key — NOT NULL
  • board_id — BIGINT — Foreign key → boards.board_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • title — VARCHAR(256) — NOT NULL
  • content — VARCHAR(512) — NOT NULL
  • view_count — INT
  • likes — INT
  • weight_value — INT
  • created_at — TIMESTAMP
  • modified_at — TIMESTAMP
  • is_deleted — TINYINT(1)

recent_post

  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • post_id — BIGINT — NOT NULL

user_like_log

  • like_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL

users

  • user_id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(256) — NOT NULL
  • password — VARCHAR(256)
  • name — VARCHAR(32) — NOT NULL
  • phone — VARCHAR(16) — NOT NULL
  • nickname — VARCHAR(256) — NOT NULL
  • gender — TINYINT(1) — NOT NULL — 0 - Male, 1 - Female
  • birth — DATE — NOT NULL
  • join_date — TIMESTAMP
  • last_login — TIMESTAMP
  • login_count — BIGINT
  • login_browser — VARCHAR(512)
  • user_level — INT
  • user_exp — BIGINT
  • point — INT
  • is_active — TINYINT(1)
  • profile_image — VARCHAR(256)
  • role — ENUM('ROLE_USER', 'ROLE_ADMIN', 'PATHFINDER', 'PIONEER', 'WALKER_HOLIC')