c

Tables (14)

categories

  • category_id — INT — Primary key — NOT NULL
  • category_name — VARCHAR(100) — NOT NULL

certifications

  • cert_id — BIGINT — Primary key — NOT NULL
  • trainer_id — BIGINT — Foreign key → trainers.trainer_id — NOT NULL
  • cert_name — VARCHAR(255) — NOT NULL
  • issuing_body — VARCHAR(255)
  • issue_date — DATE
  • file_url — VARCHAR(500)
  • approved — BOOLEAN — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_certifications_trainers_idx`

chats

  • chat_id — BIGINT — Primary key — NOT NULL
  • match_id — BIGINT — Foreign key → matches.match_id — NOT NULL
  • sender_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • content — TEXT
  • created_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_chats_matches_idx`
  • INDEX — `fk_chats_users_idx`

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_comment_id — BIGINT — Foreign key → comments.comment_id
  • content — TEXT — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_comments_posts_idx`
  • INDEX — `fk_comments_users_idx`
  • INDEX — `fk_comments_comments_idx`

matches

  • match_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • trainer_id — BIGINT — Foreign key → trainers.trainer_id — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_matches_users_idx`
  • INDEX — `fk_matches_trainers_idx`

post_likes

  • like_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
  • created_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_post_likes_posts_idx`
  • INDEX — `fk_post_likes_users_idx`

post_tags

  • id — BIGINT — Primary key — NOT NULL
  • tag_id — BIGINT — Foreign key → tags.tag_id — NOT NULL
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_post_tags_tags_idx`
  • INDEX — `fk_post_tags_posts_idx`

posts

  • post_id — BIGINT — Primary key — NOT NULL
  • post_category_id — INT — NOT NULL
  • pet_category_id — INT — Foreign key → categories.category_id
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT — NOT NULL
  • image_url — VARCHAR(500)
  • video_url — VARCHAR(500)
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_posts_users_idx`
  • INDEX — `fk_posts_categories_idx`

reviews

  • review_id — BIGINT — Primary key — NOT NULL
  • match_id — BIGINT — Foreign key → matches.match_id — NOT NULL
  • rating — DECIMAL(2,1) — NOT NULL
  • comment — TEXT
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_reviews_matches_idx`
  • Key — Foreign key — NOT NULL

subscription

  • subscription_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • expired_at — TIMESTAMP — NOT NULL
  • status — VARCHAR(50) — NOT NULL
  • INDEX — `fk_subscription_users_idx`

tags

  • tag_id — BIGINT — Primary key — NOT NULL
  • tag_name — VARCHAR(100) — NOT NULL
  • created_at — TIMESTAMP — NOT NULL

trainer_tags

  • id — BIGINT — Primary key — NOT NULL
  • tag_id — BIGINT — Foreign key → tags.tag_id — NOT NULL
  • trainer_id — BIGINT — Foreign key → trainers.trainer_id — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • INDEX — `fk_trainer_tags_tags_idx`
  • INDEX — `fk_trainer_tags_trainers_idx`

trainers

  • trainer_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • introduction — TEXT
  • experience_years — INT
  • specializations — JSON
  • visit_cost_per_hour — DECIMAL(10,2)
  • available_time — VARCHAR(500)
  • approved_at — TIMESTAMP
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

users

  • user_id — BIGINT — Primary key — NOT NULL
  • role — VARCHAR(50) — NOT NULL
  • nickname — VARCHAR(100) — NOT NULL
  • profile_image_url — VARCHAR(500)
  • status — VARCHAR(50) — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • name