curd

Tables (12)

comment

  • id — BIGINT
  • post_id — BIGINT — NOT NULL
  • user_id — BIGINT — NOT NULL
  • content — TEXT — NOT NULL
  • parent_comment_id — BIGINT
  • depth — INT — NOT NULL
  • is_deleted — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

follow

  • user_id — BIGINT — Primary key — NOT NULL
  • following_id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME — NOT NULL
  • CHECK — (user_id <> following_id)

guide

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT
  • country — VARCHAR(100)
  • city — VARCHAR(100)
  • thumbnail — TEXT
  • start_at — DATE
  • end_at — DATE
  • headcount — INT
  • state — VARCHAR(30) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • CHECK — (headcount IS NULL OR headcount >= 0)
  • CHECK — (start_at IS NULL OR end_at IS NULL OR start_at <= end_at)

guide_like

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • guide_id — BIGINT — NOT NULL
  • created_at — DATETIME — NOT NULL

post

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • post_category — VARCHAR(30) — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT
  • state — VARCHAR(30) — NOT NULL
  • start_at — DATE
  • end_at — DATE
  • country — VARCHAR(100)
  • location — VARCHAR(100)
  • thumbnail — TEXT
  • max_participants — INT
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • is_alcohol — BOOLEAN — NOT NULL
  • is_public — BOOLEAN — NOT NULL
  • is_smoking — BOOLEAN — NOT NULL
  • views — INT — NOT NULL
  • user_age_group — VARCHAR(100)
  • CHECK — (max_participants IS NULL OR max_participants >= 0)
  • CHECK — (start_at IS NULL OR end_at IS NULL OR start_at <= end_at)

post_group

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • post_id — BIGINT — NOT NULL
  • state — VARCHAR(30) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

post_like

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • post_id — BIGINT — NOT NULL
  • created_at — DATETIME — NOT NULL

reservation

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • guide_id — BIGINT — NOT NULL
  • state — VARCHAR(30) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

tags

  • id — BIGINT
  • post_id — BIGINT — NOT NULL
  • tag — VARCHAR(255) — NOT NULL
  • created_at — DATETIME — NOT NULL

timetable

  • id — BIGINT
  • guide_id — BIGINT — NOT NULL
  • title — VARCHAR(255)
  • description — VARCHAR(255)
  • start_at — DATE
  • end_at — DATE
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • CHECK — (start_at IS NULL OR end_at IS NULL OR start_at <= end_at)

user_interest

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • interest — VARCHAR(255) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

users

  • id — BIGINT
  • age — INT
  • name — VARCHAR(100) — NOT NULL
  • country — VARCHAR(100)
  • profile_image — TEXT
  • introduction — VARCHAR(300)
  • gender — TINYINT
  • is_alcohol — BOOLEAN — NOT NULL
  • is_smoking — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • CHECK — (gender IS NULL OR gender IN (0, 1, 2))