insta clone erd

Tables (7)

Untitled (posts)

  • Key (post_id) — BIGINT — Primary key — NOT NULL
  • Key (user_id) — BIGINT — Foreign key → users.Key — NOT NULL
  • Field (timestamp) — TIMESTAMP
  • Field (content) — VARCHAR(100)

Untitled (comments)

  • Key (comments_id) — BIGINT — Primary key — NOT NULL
  • Key (post_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL
  • Key (user_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL
  • Field (content) — VARCHAR(100)
  • Field (timestamp) — TIMESTAMP

Untitled (tags)

  • Key (tags_id) — BIGINT — Primary key — NOT NULL
  • Field (name) — VARCHAR(20)

Untitled (tag_post_map)

  • Key (tag_post_map_id) — BIGINT — Primary key — NOT NULL
  • Key (post_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL
  • Key (user_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL
  • Key (tags_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL

Untitled (comment_likes)

  • Key (likes_id) — BIGINT — Primary key — NOT NULL
  • Key (comments_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL
  • Key (post_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL
  • Key (user_id) — BIGINT — Foreign key → Untitled.Key — NOT NULL
  • Field (timestamp) — TIMESTAMP
  • Field (target_id) — BIGINT
  • Field (target_type) — INTEGER

Untitled2 (follower_map)

  • Key (follower_id) — BIGINT — Primary key — NOT NULL
  • Field (following_id) — BIGINT — Primary key
  • Key (user_id) — BIGINT — Foreign key → users.Key — NOT NULL
  • Field (target_id) — BIGINT

users

  • Key (user_id) — BIGINT — Primary key — NOT NULL
  • Field (email) — VARCHAR(50)
  • Field (password) — VARCHAR(50)
  • Field (name) — VARCHAR(50)