asdf

Tables (28)

AgentDriveBatches

  • agent_drive_batch_id — bigint — Primary key — NOT NULL
  • agent_id — bigint — NOT NULL
  • tenant_id — bigint — NOT NULL
  • agent_type — tinyint — NOT NULL
  • create_organization_member_id — bigint — NOT NULL
  • project_id — bigint
  • drive_id — bigint
  • latest_revision — bigint — NOT NULL
  • last_synced_at — datetime
  • fail_count — int — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL
  • index_source_type — tinyint — NOT NULL — IndexSourceType(6종) — 배치가 쓰는 값은 0 member · 1 project
  • index_source_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL — member_id 또는 project_id — VAIS struct_data 키와 같은 값
  • sync_status — tinyint — NOT NULL — 0=active, 1=paused. 행 삭제는 색인 문서 정리를 동반하는 비가역 작업이라 "잠깐 끔"과 구분한다

AiAgentAccessPermissions

  • ai_agent_access_permission_id — bigint — Primary key — NOT NULL — PK. 신규는 IdGenerator 채번, 이관분은 구 agent_id 승계
  • ai_agent_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL
  • tenant_id — bigint — NOT NULL
  • scope — tinyint — NOT NULL — 0=restricted, 1=member, 2=memberAndGuest, 3=organization
  • access_type — tinyint — scope=0,3 일 때 사용. 1=department, 2=member, 3=organization
  • target_id — bigint
  • granted_at — datetime — NOT NULL
  • granted_by_organization_member_id — bigint — NOT NULL

AiAgentMembers

  • organization_member_id — bigint — Primary key — NOT NULL
  • ai_agent_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL
  • organization_id — bigint — 관리자의 조직. 이관분은 비어 있을 수 있다
  • tenant_id — bigint — NOT NULL
  • member_role — tinyint — NOT NULL — 1=ADMIN. 현재 이 값 하나만 쓴다
  • created_at — datetime — NOT NULL
  • updated_at — datetime

AiAgentSettings

  • ai_agent_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL
  • tenant_id — bigint — NOT NULL
  • organization_id — bigint — 소속 조직. 생성 시 고정, 변경 불가
  • value_json — mediumtext — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

AiAgents

  • ai_agent_id — bigint — Primary key — NOT NULL — PK. 구 agent_id 승계 = mediator 봇 계정 id
  • tenant_id — bigint — NOT NULL
  • agent_type — tinyint — NOT NULL — AgentType.db_data 승계 — 1=빌더형(구 project), 3=익스텐션, 4=울트라, 5=빌트인
  • agent_status — tinyint — NOT NULL — 0=사용(active), 1=사용 안 함(inactive), 2=승인 대기
  • agent_code — varchar(20) — 에이전트 아이디. 테넌트 내 유일. 영문 소문자·숫자·(-_.)
  • name — varchar(64) — NOT NULL
  • nickname — varchar(64) — 선택 항목 — 구 Agents.nickname 은 NOT NULL 이었다
  • project_id — bigint — 레거시. 편입 전 소속 프로젝트. 소킹 후 DROP 후보
  • profile_image_object_id — bigint
  • builtin_agent_metadata_id — bigint — Foreign key → BuiltinAgentMetadata.builtin_agent_metadata_id — 빌트인만. BuiltinAgentMetadata 참조
  • create_organization_member_id — bigint — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

AiChatSpaces

  • ai_chat_space_id — bigint — Primary key — NOT NULL — PK. 이관분은 구 sidebar surface_id 승계, 신규는 IdGenerator 채번
  • tenant_id — bigint — NOT NULL
  • organization_id — bigint — NOT NULL — 주인의 조직
  • organization_member_id — bigint — NOT NULL — 공간의 주인
  • value_json — text — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime

AiChatbotAccessPermissions

  • ai_chatbot_access_permission_id — bigint — Primary key — NOT NULL — PK. 이관분 = 구 agent_access_permission_id 승계, 신규 = IdGenerator
  • ai_chatbot_id — bigint — Foreign key → AiChatbots.ai_chatbot_id — NOT NULL
  • tenant_id — bigint — NOT NULL
  • scope — tinyint — NOT NULL — 0=restricted, 1=member, 2=memberAndGuest, 3=organization. ⚠️ 값 순서 ≠ 랭크 순서
  • access_type — tinyint — scope=0·3 일 때 사용. 1=department, 2=member, 3=organization
  • target_id — bigint
  • granted_at — datetime — NOT NULL
  • granted_by_organization_member_id — bigint — NOT NULL

AiChatbotEmbedApps

  • ai_chatbot_embed_app_id — bigint — Primary key — NOT NULL — PK. 구 embedding_app_id 승계
  • tenant_id — bigint — NOT NULL
  • ai_chatbot_id — bigint — Foreign key → AiChatbots.ai_chatbot_id — NOT NULL — 구 chatbot_id(=surface_id) 값 동일
  • created_at — datetime — NOT NULL
  • expired_at — datetime — NOT NULL — 만료 검증
  • token — varchar(255) — NOT NULL — 임베드 인증 토큰
  • description_enc — mediumtext — 암호화 설명
  • domain_name — varchar(255) — NOT NULL — Origin 제한

AiChatbotMembers

  • organization_member_id — bigint — Primary key — NOT NULL
  • ai_chatbot_id — bigint — Foreign key → AiChatbots.ai_chatbot_id — NOT NULL
  • organization_id — bigint — NOT NULL — 관리자의 조직. 관리자 조직 동기화가 갱신
  • tenant_id — bigint — NOT NULL
  • member_role — tinyint — NOT NULL — 1=ADMIN. 현재 이 값 하나만 쓴다
  • created_at — datetime — NOT NULL
  • updated_at — datetime

AiChatbotSettings

  • ai_chatbot_id — bigint — Foreign key → AiChatbots.ai_chatbot_id — NOT NULL
  • tenant_id — bigint — NOT NULL
  • value_json — mediumtext — 구 AgentSettings.value_json 승계. 키 계약은 model/agent/agent_settings.py 가 SoT
  • created_at — datetime — NOT NULL
  • updated_at — datetime

AiChatbots

  • ai_chatbot_id — bigint — Primary key — NOT NULL — PK. 이관분 = 구 surface_id (색인 키 — 값 변경 금지), 신규 = IdGenerator
  • tenant_id — bigint — NOT NULL
  • organization_id — bigint — NOT NULL — 소속 조직. 생성 시 고정
  • create_organization_member_id — bigint — NOT NULL — 생성자. 승인 요청자이자 관리자 시딩 원본
  • name — varchar(45) — NOT NULL — 구 Agents.name 승계(미러인 surface_name 이 아니다 — 실측 47건이 갈렸다). 기획 글자수 제한은 앱 검증
  • description — varchar(255) — 신규 필수(승인 항목 "챗봇명+설명"). 이관분은 원본이 없어 NULL
  • chatbot_status — tinyint — NOT NULL — 0=사용, 1=사용 안 함, 2=승인 대기
  • is_unlogged — tinyint — NOT NULL — 1=비기록(로그 미저장·메신저 차단·비가역). 공유 URL 타입만 전환 가능
  • ingestion_status — tinyint — NOT NULL — BotStatus 승계 — 0=enabled, 1=pending, 2=paused. 자료 반영 롤업(파생값). ⚠️ IngestionStatus 와 값이 겹치나 다른 체계다
  • resource_token — varchar(255) — 위키 공유링크 토큰. 보유 시 공개 범위는 위키 공유 설정을 따른다
  • legacy_agent_id — bigint — 레거시. 구 customAgent agent_id. 신규는 NULL, 소킹 후 DROP 후보
  • profile_image_object_id — bigint — 아이콘. 구 Agents.profile_image_object_id 승계
  • gcp_project — varchar(255) — VAIS 라우팅 SoT. 구 SurfaceSettings.gcp_project 승계. NULL=기본 프로젝트
  • created_at — datetime — NOT NULL
  • updated_at — datetime

AiTenantSettings

  • ai_tenant_settings_id — bigint — Primary key — NOT NULL — PK. IdGenerator 채번
  • tenant_id — bigint — NOT NULL
  • ai_subscribed — tinyint(1) — NOT NULL — 1=구독, 0=구독 안 함. 1→0 이 P-10 일괄 삭제의 방아쇠다
  • approval_service_enabled — tinyint(1) — NOT NULL — 1=사용, 0=사용 안 함. 테넌트 생성 시 기본값은 사용 안 함(기획)
  • created_at — datetime — NOT NULL
  • updated_at — datetime

BuiltinAgentMetadata

  • builtin_agent_metadata_id — bigint — Primary key — NOT NULL
  • name — varchar(64) — NOT NULL
  • description — varchar(255)
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

Chats

  • chat_id — bigint — Primary key — NOT NULL
  • tenant_id — bigint — NOT NULL
  • create_organization_member_id — bigint
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL
  • title — varchar(45) — NOT NULL
  • status — tinyint — NOT NULL — 대화 상태 (open, close, deleted)
  • closed_at — datetime
  • deleted_at — datetime
  • last_message_created_at — datetime — NOT NULL
  • session_id — varchar(255) — 비로그인 사용자의 세션 아이디
  • chatbot_id — bigint
  • surface_id — bigint
  • options_json — varchar(500) — Chat 옵션을 JSON 형태로 저장 (예: {"includeType": "body_with_comments"})
  • chat_kind — tinyint — NOT NULL — 컨테이너 종류. 0=aiChat, 1=chatbot, 2=contentChat, 3=notebook
  • container_id — bigint — Foreign key → Notebooks.notebook_id — 컨테이너 행 id. chat_kind 로 해석 — AiChatSpaces | AiChatbots | ContentChatSpaces | Notebooks
  • my_data_enabled_flag — tinyint(1) — NOT NULL — 내 데이터 참조 설정. 0=off, 1=on

ChatsAiAgents

  • ai_agent_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL
  • chat_id — bigint — Foreign key → Chats.chat_id — NOT NULL
  • tenant_id — bigint — NOT NULL
  • created_at — datetime — NOT NULL

ContentChatSpaces

  • content_chat_space_id — bigint — Primary key — NOT NULL — PK. 이관분은 구 surface_id 승계 (Chats 백필이 단순 복사가 된다), 신규는 IdGenerator 채번
  • tenant_id — bigint — NOT NULL
  • organization_id — bigint — NOT NULL
  • create_organization_member_id — bigint — NOT NULL — 최초 생성자. 공간은 여러 사용자가 공유하고 권한 판정은 이 값 기준
  • service_type — tinyint — NOT NULL — ServiceType.db_data — 0=wikiPage, 1=post, 2=mail, 3=driveFile. 신규 유입은 3 만
  • service_resource_id — varchar(255) — NOT NULL — 콘텐츠 원본 ID
  • gcp_project — varchar(255) — VAIS 라우팅 SoT. 구 SurfaceSettings.gcp_project 승계. NULL=기본 프로젝트
  • created_at — datetime — NOT NULL
  • updated_at — datetime

IngestionQueues

  • ingest_queue_id — bigint — Primary key — NOT NULL
  • tenant_id — bigint — NOT NULL
  • ingest_id — bigint — Foreign key → Ingestions.ingest_id — NOT NULL
  • chatbot_id — bigint — NOT NULL
  • agent_id — bigint
  • create_organization_member_id — bigint — NOT NULL
  • status — tinyint — NOT NULL
  • started_at — datetime
  • completed_at — datetime
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL
  • index_source_type — tinyint — NOT NULL — IndexSourceType — Ingestions 와 같은 값 집합
  • index_source_id — bigint — NOT NULL — 소유자 id. Ingestions.index_source_id 와 동일해야 한다(앱 불변식)

IngestionResources

  • ingest_resource_id — bigint — Primary key — NOT NULL
  • tenant_id — bigint — NOT NULL
  • ingest_id — bigint — Foreign key → Ingestions.ingest_id — NOT NULL
  • service_resource_id — bigint — NOT NULL
  • index_status — tinyint — NOT NULL
  • error_message — text
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL
  • knowledge_source_id — bigint — Foreign key → KnowledgeSources.knowledge_source_id — 이 리소스가 어느 등록 건인가. KnowledgeSources
  • source_version — bigint — 이 작업이 색인한 원본 버전

Ingestions

  • ingest_id — bigint — Primary key — NOT NULL
  • chatbot_id — bigint — NOT NULL
  • agent_id — bigint
  • tenant_id — bigint — NOT NULL
  • source_document_id — bigint
  • status — tinyint — NOT NULL
  • service_type — tinyint
  • resource_token — varchar(255)
  • service_resource_id — bigint
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL
  • current — int
  • total — int
  • index_source_type — tinyint — NOT NULL — IndexSourceType — 0 member · 1 project · 2 chatbot · 3 notebook · 4 contentChat · 5 agent
  • index_source_id — bigint — NOT NULL — 소유자 id. type 별 해석: chatbot → ai_chatbot_id, notebook → notebook_id …

KnowledgeSources

  • knowledge_source_id — bigint — Primary key — NOT NULL — IdGenerator 채번
  • tenant_id — bigint — NOT NULL
  • index_source_type — tinyint — NOT NULL — IndexSourceType — 0 member · 1 project · 2 chatbot · 3 notebook · 4 contentChat · 5 agent
  • index_source_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL — 소유자 id. type 별 해석은 01-ingestion-source-keying.sql 과 동일
  • service_type — tinyint — NOT NULL — ServiceType.db_data — 0 wikiPage · 3 driveFile · 4 upload(신설)
  • service_resource_id — varchar(255) — NOT NULL — upload 는 StorageGw object_id
  • include_sub_resources — tinyint(1) — NOT NULL — 하위 포함. 신규 등록은 항상 0(기획 미제공), 이관분은 원본 SourceDocuments.include_sub_documents 승계
  • source_document_id — bigint — Foreign key → SourceDocuments.source_document_id — 위키만 채운다. 드라이브·업로드는 살아 있는 SourceDocuments 행이 없다
  • resource_token — varchar(255) — 이 행이 나온 위키 공유 URL 토큰. 공유 URL 환원 행만 값이 있다(직접 등록·드라이브·업로드는 NULL). 본체 AiChatbots.resource_token 과 용도가 다르다 — 이쪽은 행 단위 소유 표식
  • source_version — bigint — 마지막 성공 색인의 원본 버전. 큐 워커 스킵 판정
  • page_count — int — PDF 변환 기준 페이지 수. 2,000p 누적 검증. 위키는 NULL
  • original_name — varchar(255) — upload 전용. 위키·드라이브는 원본 API 가 준다
  • size_bytes — bigint — upload 전용 바이트 크기. 위키·드라이브는 원본 API 가 준다
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

MemberAiAgentFavorites

  • tenant_id — bigint — Primary key — NOT NULL
  • organization_member_id — bigint — Primary key — NOT NULL
  • ai_agent_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL
  • created_at — datetime — NOT NULL

MemberMemorySettings

  • member_memory_setting_id — bigint — Primary key — NOT NULL — PK. 승계 원본이 없어 전부 IdGenerator 채번
  • tenant_id — bigint — NOT NULL
  • organization_member_id — bigint — NOT NULL — 토글의 주인. 공간이 아니라 사람에게 붙는다
  • memory_enabled — tinyint(1) — NOT NULL — 개인 메모리 토글. 기본 ON
  • value_json — text
  • created_at — datetime — NOT NULL
  • updated_at — datetime

MemberPrompts

  • member_prompt_id — bigint — Primary key — NOT NULL — PK. 이관분은 대표 sidebar surface_id 승계, 신규는 IdGenerator 채번
  • tenant_id — bigint — NOT NULL
  • organization_member_id — bigint — NOT NULL — 지침의 주인. 공간이 아니라 사람에게 붙는다
  • basic_info — text — 기본 정보 프롬프트. 구 SurfaceSettings.value_json.basicInfo
  • response_style — text — 응답 스타일 프롬프트. 구 SurfaceSettings.value_json.responseStyle
  • created_at — datetime — NOT NULL
  • updated_at — datetime

MessageFeedbacks

  • message_id — bigint — Primary key — NOT NULL
  • like_flag — tinyint(1) — NOT NULL — 긍정(1) / 부정(0)
  • feedback_enc — varchar(1024) — 추가 답변
  • tenant_id — bigint — NOT NULL
  • chatbot_id — bigint — NOT NULL
  • surface_id — bigint
  • feedback_at — datetime — NOT NULL
  • answer_type — tinyint — NOT NULL
  • question_content_enc — mediumtext — NOT NULL
  • answer_content_enc — mediumtext — NOT NULL
  • organization_member_id — bigint
  • session_id — varchar(255)
  • chat_kind — tinyint — NOT NULL — 컨테이너 종류. Chats.chat_kind 와 같은 값 집합. 피드백은 1(chatbot) 뿐
  • container_id — bigint — Foreign key → AiChatbots.ai_chatbot_id — 컨테이너 행 id. chat_kind 로 해석 — 피드백은 AiChatbots.ai_chatbot_id

MessagesAiAgents

  • message_id — bigint — Primary key — NOT NULL
  • ai_agent_id — bigint — Foreign key → AiAgents.ai_agent_id — NOT NULL — FK 없음 — 삭제된 에이전트 id 가 남을 수 있다
  • tenant_id — bigint
  • agent_name — varchar(64) — 답변 시점 이름 스냅샷
  • selection_reason — varchar(255) — 선정 사유 한 줄. 평문

NotebookSettings

  • notebook_id — bigint — Foreign key → Notebooks.notebook_id — NOT NULL — PK/FK → Notebooks
  • tenant_id — bigint — NOT NULL — Notebooks.tenant_id 와 일치 — 앱 불변식(FK 아님)
  • name — varchar(20) — NOT NULL — 노트북 이름(스펙 20자)
  • instructions — text — 지침 — 이 노트북 답변의 기준
  • memory_enabled — tinyint(1) — NOT NULL — 노트북별 메모리 토글(on/off). 기본 OFF
  • memory_wiki_id — bigint — 메모리 페이지가 속한 위키 ID(소유자 개인 위키). NULL=미생성
  • memory_page_id — bigint — 매핑된 위키 메모리 페이지 ID. NULL=미생성(첫 기록 시 생성·채움 — 토글 ON 아님), 이름변경과 무관하게 안정 식별
  • value_json — text — 페르소나 등 확장 여지
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

Notebooks

  • notebook_id — bigint — Primary key — NOT NULL — PK. IdGenerator 채번
  • tenant_id — bigint — NOT NULL
  • organization_id — bigint
  • create_organization_member_id — bigint — NOT NULL — 소유자
  • status — tinyint — NOT NULL — 0 active · 1 deleted (soft delete)
  • gcp_project — varchar(255) — VAIS 라우팅 SoT. 생성 시 1회 기록 후 불변. NULL=기본 프로젝트
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL — 목록 최신순 정렬 키

SourceDocuments

  • source_document_id — bigint — Primary key — NOT NULL
  • tenant_id — bigint — NOT NULL
  • service_type — tinyint — NOT NULL — ServiceType.db_data — 0=wikiPage, 1=post, 2=mail, 3=driveFile. 현행 유입은 0 만
  • service_resource_id — varchar(255) — NOT NULL — 서비스 원본 아이디 (token_id, project_id, task_id 등)
  • include_sub_documents — bit(1) — NOT NULL — 하위 문서 포함 여부
  • service_container_id — bigint — 원본을 담고 있는 컨테이너 ID (service_type 별 해석: 위키 → 위키 ID) — 벡터 namespace 해석용. NULL 이면 레거시(source_document_id)\n namespace
  • last_indexed_at — datetime — 마지막 색인·재색인 완료 시각