InstagramClone

Tables (10)

comments

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • post_id — BIGINT — NOT NULL
  • content — TEXT — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

direct_messages

  • id — BIGINT
  • sender_id — BIGINT — NOT NULL
  • receiver_id — BIGINT — NOT NULL
  • content — TEXT — NOT NULL
  • is_read — BOOLEAN
  • created_at — TIMESTAMP

follows

  • id — BIGINT
  • follower_id — BIGINT — NOT NULL
  • following_id — BIGINT — NOT NULL
  • created_at — TIMESTAMP

hashtags

  • id — BIGINT
  • tag — VARCHAR(100) — NOT NULL

likes

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

notifications

  • id — BIGINT
  • receiver_id — BIGINT — NOT NULL
  • sender_id — BIGINT — NOT NULL
  • type — ENUM('like', 'comment', 'follow', 'mention') — NOT NULL
  • post_id — BIGINT
  • is_read — BOOLEAN
  • created_at — TIMESTAMP

post_hashtags

  • id — BIGINT
  • post_id — BIGINT — NOT NULL
  • hashtag_id — BIGINT — NOT NULL

posts

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • content — TEXT
  • media_url — TEXT — NOT NULL
  • is_video — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

stories

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • media_url — TEXT — NOT NULL
  • is_video — BOOLEAN
  • expires_at — TIMESTAMP — NOT NULL
  • created_at — TIMESTAMP

users

  • id — BIGINT
  • username — VARCHAR(50) — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • profile_img — TEXT
  • bio — TEXT
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP