GPTchat

Tables (6)

account

  • Key (provider) — text — Primary key — NOT NULL
  • Key2 (providerAccountId) — text — Primary key — NOT NULL
  • Field (type) — text — NOT NULL — type<AdapterAccount["type"]>
  • Field (refresh_token) — text
  • Field2 (access_token) — text
  • Field (expires_at) — integer
  • Field (token_type) — text
  • Field (scope) — text
  • Field (id_token) — text
  • Field (session_state) — text
  • Key (userId) — text — Foreign key → user.Key — NOT NULL

chat

  • Key (chatId) — Primary key — NOT NULL
  • workspaceId — Foreign key → workspace.workspaceId — NOT NULL
  • Field (name) — text — NOT NULL
  • Field (videoId) — text
  • Field (createdAt) — timestamp — NOT NULL — yyyy-mm-dd-hh-mm-ss

message

  • Key (messageId) — Primary key — NOT NULL
  • Key (chatId) — Foreign key → chat.Key — NOT NULL
  • Field (content) — text — NOT NULL
  • Field (role) — text — NOT NULL — "user", "assistant", "system"
  • Field (createdAt) — timestamp — NOT NULL — yyyy-mm-dd-hh-mm-ss
  • Field (vec) — tsvector

user

  • Key (userId) — text — Primary key — NOT NULL
  • Field (name) — text
  • Field (email) — text — NOT NULL
  • Field (emailVerified) — integer — mode: "timestamp_ms"
  • Field (image) — text
  • Field (password) — text
  • Field (role) — text
  • Field (isTwoFactorEanbled) — boolean
  • workspaceId (personalWorkspace) — text — Foreign key → workspace.workspaceId — NOT NULL

userInWorkspace

  • workspaceId — Foreign key → workspace.workspaceId — NOT NULL
  • Key (userId) — text — Foreign key → user.Key — NOT NULL
  • Field (accept) — NOT NULL — true,false
  • Field (isHost) — boolean — NOT NULL — true, false

workspace

  • workspaceId — text — Primary key — NOT NULL
  • Field (workspaceName) — text — NOT NULL
  • Field (description) — text
  • Field (type) — text — NOT NULL — personal, team
  • Field (createdAt) — timestamp — NOT NULL — yyyy-mm-dd-hh-mm-ss