chat_GPT_clone

Tables (4)

conversation (채팅방)

  • id (아이디) — pk — Primary key — NOT NULL
  • users_id (유저아이디) — fk — Foreign key → users.id — NOT NULL
  • title (제목) — varchar(255)
  • created_at (생성일) — timestamp
  • updated_at (업데이트일) — timestamp

message (메세지)

  • id (아이디) — pk — Primary key — NOT NULL
  • parente_id (부모아이디) — fk — Foreign key → message.id — NOT NULL
  • conversation_id (채팅방아이디) — fk — Foreign key → conversation.id — NOT NULL
  • role (역할) — enum(user, assistant)
  • content (내용) — text
  • created_at (생성일) — timestamp

prompt (프롬프트)

  • id (아이디) — pk — Primary key — NOT NULL
  • users_id (사용자아이디) — fk — Foreign key → users.id — NOT NULL
  • title (제목) — varchar(255)
  • content (내용) — text
  • created_at (생성일) — timestamp
  • updated_at (갱신일) — timestamp

users (유저)

  • id (아이디) — pk — Primary key — NOT NULL
  • name (이름) — varchar(50)
  • email (이메일) — varchar(100)
  • password (패스워드) — varchar(255)
  • api_key (인증키) — varchar(255) — NOT NULL
  • created_at (생성일) — timestamp
  • updated_at (업데이트일) — timestamp