4-liam-kim-erd

Tables (7)

post_comments

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • deleted_at — DATETIME(6)
  • post_id — BIGINT — Foreign key → posts.id — NOT NULL
  • writer_id — BIGINT — Foreign key → users.id — NOT NULL
  • content — TEXT — NOT NULL

post_likes

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • deleted_at — DATETIME(6)
  • post_id — BIGINT — Foreign key → posts.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL

posts

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • deleted_at — DATETIME(6)
  • writer_id — BIGINT — Foreign key → users.id — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT — NOT NULL
  • thumbnail_img_id — BIGINT — Foreign key → stored_files.id

stored_files

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • deleted_at — DATETIME(6)
  • name — VARCHAR(255) — NOT NULL
  • ext — VARCHAR(255) — NOT NULL
  • path — VARCHAR(255) — NOT NULL
  • hash — VARCHAR(255) — NOT NULL

user_post_view_histories

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • deleted_at — DATETIME(6)
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • post_id — BIGINT — Foreign key → posts.id — NOT NULL

user_refresh_tokens

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • deleted_at — DATETIME(6)
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • token — VARCHAR(255) — NOT NULL
  • expires_at — DATETIME(6) — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • deleted_at — DATETIME(6)
  • profile_img_id — BIGINT — Foreign key → stored_files.id
  • name — VARCHAR(255) — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password — VARCHAR(255) — NOT NULL