erdv1.0

Tables (9)

Bookmarks

  • bookmark_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
  • created_at — DATETIME — NOT NULL

Comments

  • comment_id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → Posts.post_id — NOT NULL
  • user_id — BIGINT — Foreign key → Users.user_id — NOT NULL
  • parent_id — BIGINT — Foreign key → Comments.comment_id
  • content — NVARCHAR(1000) — NOT NULL
  • is_deleted — BIT — NOT NULL
  • created_at — DATETIME — NOT NULL

Notifications

  • notification_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → Users.user_id — NOT NULL
  • sender_id — BIGINT — Foreign key → Users.user_id
  • type — VARCHAR(50) — NOT NULL
  • resource_id — BIGINT
  • is_read — BIT — NOT NULL
  • created_at — DATETIME — NOT NULL

Post_Drafts

  • draft_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → Users.user_id — NOT NULL
  • post_id — BIGINT — Foreign key → Posts.post_id
  • title — NVARCHAR(255)
  • content_md — NVARCHAR(MAX)
  • saved_at — DATETIME — NOT NULL

Post_Likes

  • post_id — BIGINT — Foreign key → Posts.post_id — NOT NULL
  • user_id — BIGINT — Foreign key → Users.user_id — NOT NULL
  • created_at — DATETIME — NOT NULL

Post_Tags

  • post_id — BIGINT — Foreign key → Posts.post_id — NOT NULL
  • tag_id — INT — Foreign key → Tags.tag_id — NOT NULL

Posts

  • post_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → Users.user_id — NOT NULL
  • title — NVARCHAR(255) — NOT NULL
  • content_md — NVARCHAR(MAX) — NOT NULL
  • url_slug — VARCHAR(255) — NOT NULL
  • view_count — INT — NOT NULL
  • like_count — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

Tags

  • tag_id — INT — Primary key — NOT NULL
  • name — NVARCHAR(50) — NOT NULL
  • created_at — DATETIME — NOT NULL

Users

  • user_id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • nickname — NVARCHAR(50) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME
  • is_active — BIT — NOT NULL