test

Tables (27)

agent_run_events

  • event_id — bigint — Primary key — NOT NULL
  • task_id — varchar(64) — Foreign key → agent_runs.task_id — NOT NULL
  • event_type — varchar(40) — NOT NULL
  • status — varchar(30) — NOT NULL
  • message — text
  • created_at — datetime — NOT NULL

agent_runs

  • task_id — varchar(64) — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id
  • chat_session_id — bigint — Foreign key → chat_sessions.chat_session_id
  • status — varchar(30) — NOT NULL
  • plan_json — longtext
  • current_step — int — NOT NULL
  • attempt — int — NOT NULL
  • max_attempts — int — NOT NULL
  • preview_url — varchar(1000)
  • summary — text
  • error — text
  • question — text
  • input_value — text
  • failure_log — text
  • suggested_fix — text
  • next_run_at — datetime
  • lease_owner — varchar(100)
  • lease_until — datetime
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

approvals

  • approval_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id
  • chat_session_id — bigint — Foreign key → chat_sessions.chat_session_id
  • task_id — varchar(64) — Agent task 승인은 값 있음, standalone(직접 요청) 승인은 NULL
  • approval_type — varchar(30) — NOT NULL
  • status — varchar(20) — NOT NULL
  • summary — varchar(500) — NOT NULL
  • created_at — datetime — NOT NULL
  • decided_at — datetime

audit_logs

  • audit_log_id — bigint — Primary key — NOT NULL
  • category — varchar(20) — NOT NULL — GITHUB | DEPLOYMENT | DOMAIN | INFRA
  • action — varchar(40) — NOT NULL — AuditAction enum 이름 (design §3.1 카탈로그)
  • outcome — varchar(20) — NOT NULL — SUCCEEDED | FAILED
  • actor_type — varchar(20) — NOT NULL — USER | AGENT | SYSTEM
  • actor_user_id — bigint — 행위 귀속 사용자. SYSTEM 이벤트도 소유자 추적 가능하면 세팅
  • project_id — bigint — 이번 단위 기록 지점은 전부 값 세팅. 계정 수준 이벤트 대비 NULL 허용. FK 없음(ADR-A3)
  • resource_type — varchar(30) — REPOSITORY | DEPLOYMENT | DOMAIN_BINDING | PREVIEW_SESSION | INFRA_CONFIG_CHANGE | CHANGE
  • resource_id — varchar(255) — 대상 식별자 (숫자 PK 또는 repo full name 등 자연키 문자열화)
  • task_id — varchar(64) — agent task 상관관계 (agent_runs.task_id 값 — FK 아님)
  • approval_id — bigint — 승인 상관관계 (approvals.approval_id 값 — FK 아님)
  • detail — varchar(1000) — 코드가 조립한 화이트리스트 요약. 토큰/시크릿/환경변수 값/로그 본문 저장 금지(design §7)
  • error_summary — varchar(500) — 실패 시 예외 요약 — SecretRedactor 적용 + 500자 절단 후 저장
  • created_at — datetime — NOT NULL

chat_messages

  • message_id — bigint — Primary key — NOT NULL
  • chat_session_id — bigint — Foreign key → chat_sessions.chat_session_id — NOT NULL — 사용자의 레포에 대한 채팅 세션 id
  • role — enum('user', 'assistant', 'system') — NOT NULL — 작성자 역할 (user, assistant, system)
  • content — text — NOT NULL — 채팅 내용
  • token_count — bigint — NOT NULL — LLM 사용 토큰 수
  • created_at — datetime — NOT NULL — 메시지 생성 시간

chat_sessions

  • chat_session_id — bigint — Primary key — NOT NULL — 사용자의 레포에 대한 채팅 세션 id
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • title — varchar(120) — NOT NULL
  • is_deleted — tinyint(1) — NOT NULL — 삭제 여부 (0: 사용, 1: 삭제)
  • deleted_at — datetime — 채팅 휴지통 처리 시점
  • created_at — datetime — NOT NULL — 채팅 세션 생성 시간
  • updated_at — datetime — NOT NULL — 채팅 세션 수정 시간

cloud_connection_verification_jobs

  • job_id — varchar(36) — Primary key — NOT NULL
  • cloud_connection_id — bigint — Foreign key → cloud_connections.cloud_connection_id — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • status — varchar(30) — NOT NULL
  • connection_status — varchar(40) — NOT NULL
  • message — text — NOT NULL
  • attempt — int — NOT NULL
  • lease_owner — varchar(120)
  • lease_until — datetime
  • created_at — datetime — NOT NULL
  • started_at — datetime
  • completed_at — datetime
  • updated_at — datetime — NOT NULL

cloud_connections

  • cloud_connection_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • provider — varchar(20) — NOT NULL — AWS | GCP
  • display_name — varchar(100) — NOT NULL — 사용자가 구분하기 위한 연결 이름
  • account_id — varchar(50) — AWS account ID
  • region — varchar(80) — NOT NULL — 배포 기본 리전
  • role_arn — varchar(255) — AWS AssumeRole ARN
  • aws_credential_type — varchar(30) — ACCESS_KEY | ROLE_ARN
  • access_key_id — varchar(80) — AWS access key ID
  • secret_access_key — mediumtext — AES encrypted AWS secret access key
  • session_token — mediumtext — AES encrypted AWS session token
  • gcp_credential_type — varchar(40) — SERVICE_ACCOUNT_KEY | SERVICE_ACCOUNT_EMAIL
  • service_account_key_json — mediumtext — AES encrypted GCP service account key JSON
  • gcp_project_id — varchar(255) — GCP project ID
  • service_account_email — varchar(255) — GCP service account email
  • status — varchar(40) — NOT NULL — VALIDATED | VERIFYING | CONNECTED | provider error status
  • last_checked_at — datetime — 마지막 health 확인 시각
  • created_at — datetime — NOT NULL — 클라우드 연결 등록 시각
  • updated_at — datetime — NOT NULL — 클라우드 연결 수정 시각

deployment_failure_analyses

  • analysis_id — bigint — Primary key — NOT NULL
  • history_id — bigint — Foreign key → deployment_histories.history_id — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • source — varchar(20) — NOT NULL — LLM | RULE_BASED
  • summary — text — NOT NULL
  • log_excerpt — mediumtext — NOT NULL
  • suggested_fix — text — NOT NULL
  • provider — varchar(20) — 분석에 사용한 AI provider (RULE_BASED면 NULL)
  • model — varchar(100)
  • created_at — datetime — NOT NULL

deployment_histories

  • history_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • project_id — bigint — NOT NULL — Dvely 프로젝트 ID
  • deploy_target_type — varchar(20) — NOT NULL — LATEST | VERSION
  • version_label — varchar(100) — VERSION 배포 시 태그명
  • deployed_url — varchar(512)
  • status — varchar(30) — NOT NULL — IN_PROGRESS | LIVE | FAILED
  • workflow_run_id — bigint
  • correlation_id — varchar(36) — NOT NULL
  • commit_sha — varchar(40)
  • workflow_head_sha — varchar(40)
  • title — varchar(500)
  • description — text
  • merged_by — varchar(100)
  • merged_by_avatar_url — varchar(1000)
  • pr_number — int
  • merged_at — datetime
  • agent_task_id — varchar(64)
  • error_message — text
  • failure_code — varchar(40)
  • attempt — int — NOT NULL
  • max_attempts — int — NOT NULL
  • next_run_at — datetime
  • lease_owner — varchar(100)
  • lease_until — datetime
  • retried_from_history_id — bigint — Foreign key → deployment_histories.history_id
  • triggered_at — datetime — NOT NULL — 배포 트리거 시각
  • updated_at — datetime — NOT NULL — 상태 변경 시각

deployments

  • deployment_id — bigint — Primary key — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • pipeline_id — bigint — Foreign key → pipelines.pipeline_id — NOT NULL
  • deploy_url — varchar(512) — NOT NULL — 배포된 서비스 URL
  • status — varchar(50) — NOT NULL — 배포 상태 (pending, success, failed)
  • log — text — NOT NULL — 배포 로그
  • deployed_at — datetime — NOT NULL — 배포 시작 시간
  • created_at — datetime — NOT NULL

domains

  • domain_id — bigint — Primary key — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • domain_name — varchar(255) — NOT NULL — 도메인 주소
  • domain_type — varchar(30) — NOT NULL
  • hosting_target — varchar(30) — NOT NULL
  • status — varchar(30) — NOT NULL
  • verification_method — varchar(10)
  • dns_target — varchar(512)
  • cloudflare_record_id — varchar(100)
  • last_checked_at — datetime
  • https_enforced — tinyint(1) — NOT NULL — 실제 HTTPS 강제 적용 여부
  • certificate_status — varchar(30) — NOT NULL
  • certificate_expires_at — date
  • dns_verified — tinyint(1) — NOT NULL — DNS 인증 여부 (0: 미인증, 1: 인증완료)
  • created_at — datetime — NOT NULL — 도메인 등록 시간
  • updated_at — datetime — NOT NULL — 도메인 수정 시간

environment_variable_histories

  • environment_variable_history_id — bigint — Primary key — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • environment_variable_id — bigint — Foreign key → environment_variables.environment_variable_id — 원본 삭제 시 NULL
  • scope — varchar(20) — NOT NULL
  • env_key — varchar(128) — NOT NULL
  • action — varchar(20) — NOT NULL — CREATED | UPDATED | DELETED
  • secret — tinyint(1) — NOT NULL
  • value_changed — tinyint(1) — NOT NULL
  • actor_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • created_at — datetime — NOT NULL

environment_variables

  • environment_variable_id — bigint — Primary key — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • scope — varchar(20) — NOT NULL — PREVIEW | PRODUCTION
  • env_key — varchar(128) — NOT NULL — POSIX 환경변수 키 (case-sensitive)
  • env_value — mediumtext — NOT NULL — AES-256-GCM 암호문(Base64), 애플리케이션 레벨 암호화
  • secret — tinyint(1) — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

pipelines

  • pipeline_id — bigint — Primary key — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • created_at — datetime — NOT NULL

preview_sessions

  • preview_session_id — varchar(36) — Primary key — NOT NULL
  • access_token — varchar(64) — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id
  • chat_session_id — bigint — Foreign key → chat_sessions.chat_session_id
  • task_id — varchar(64) — Foreign key → agent_runs.task_id
  • container_id — varchar(128) — NOT NULL
  • host_port — int — NOT NULL
  • status — varchar(20) — NOT NULL
  • failure_reason — varchar(500)
  • public_url — varchar(1000) — NOT NULL
  • expires_at — datetime — NOT NULL
  • last_accessed_at — datetime — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

project_approval_policies

  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • change_approval_required — tinyint(1) — NOT NULL
  • deployment_approval_required — tinyint(1) — NOT NULL
  • domain_approval_required — tinyint(1) — NOT NULL
  • infra_approval_required — tinyint(1) — NOT NULL
  • result_approval_required — tinyint(1) — NOT NULL — 실행 결과(preview·diff) 확인 후 main 반영(RESULT) 승인 필요 여부

project_budget_settings

  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • monthly_budget_amount — decimal(12,2) — NOT NULL
  • currency — varchar(3) — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

project_changes

  • change_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id
  • chat_session_id — bigint — Foreign key → chat_sessions.chat_session_id
  • task_id — varchar(64) — Foreign key → agent_runs.task_id — NOT NULL
  • preview_session_id — varchar(36) — Foreign key → preview_sessions.preview_session_id — NOT NULL
  • status — varchar(30) — NOT NULL
  • summary — text
  • diff_text — mediumtext
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL
  • approval_id — bigint — Foreign key → approvals.approval_id — 결과 승인(RESULT) 행. 게이트 미발동·legacy 변경은 NULL
  • pr_number — int — preview→main 반영 PR 번호 (멱등 no-op merge는 NULL)
  • merge_commit_sha — varchar(64) — main 반영 커밋 SHA
  • merged_at — datetime — main 반영 시각

project_cloud_connection_settings

  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • cloud_connection_id — bigint — Foreign key → cloud_connections.cloud_connection_id — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

project_infrastructure_setting_changes

  • change_id — bigint — Primary key — NOT NULL
  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • action — varchar(20) — NOT NULL — CREATED | UPDATED
  • status — varchar(30) — NOT NULL — APPLIED | PENDING_APPROVAL | REJECTED
  • deployment_architecture — varchar(20) — NOT NULL
  • compute_tier — varchar(20) — NOT NULL
  • storage_type — varchar(30) — NOT NULL
  • network_access — varchar(20) — NOT NULL
  • approval_id — bigint — Foreign key → approvals.approval_id — 즉시 적용 변경은 NULL
  • actor_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • created_at — datetime — NOT NULL
  • decided_at — datetime — APPLIED/REJECTED 확정 시각

project_infrastructure_settings

  • project_id — bigint — Foreign key → projects.project_id — NOT NULL
  • deployment_architecture — varchar(20) — NOT NULL — SERVER | CONTAINER | SERVERLESS
  • compute_tier — varchar(20) — NOT NULL — MICRO | SMALL | MEDIUM | LARGE (provider-중립 티어)
  • storage_type — varchar(30) — NOT NULL — NONE | OBJECT_STORAGE
  • network_access — varchar(20) — NOT NULL — PUBLIC | PRIVATE
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

projects

  • project_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • project_name — varchar(255) — NOT NULL
  • project_status — varchar(50) — NOT NULL
  • start_mode — varchar(50) — NOT NULL
  • template_type — varchar(100)
  • draft_mode — varchar(50) — NOT NULL
  • deploy_status — varchar(50) — NOT NULL
  • current_url — varchar(512)
  • current_version — varchar(100)
  • source_repository — varchar(255)
  • deployment_repository — varchar(255)
  • repository_visibility — varchar(20) — NOT NULL
  • binding_status — varchar(30) — NOT NULL
  • repository_health — varchar(30) — NOT NULL
  • repository_head_sha — varchar(40)
  • repository_head_message — varchar(1000)
  • repository_head_author — varchar(255)
  • repository_head_committed_at — datetime
  • repository_head_synced_at — datetime
  • repository_version — varchar(100)
  • repository_version_synced_at — datetime
  • repository_connected_at — datetime — GitHub 저장소 연결 시각. 해제 시 NULL, 레거시 연결 행은 NULL(백필 안 함)
  • is_deleted — tinyint(1) — NOT NULL
  • version — bigint — NOT NULL — JPA @Version 낙관적 잠금 카운터
  • created_at — datetime — NOT NULL — repo 사용 등록 일시
  • updated_at — datetime — NOT NULL — repo 수정 일시

refresh_tokens

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • token — varchar(36) — NOT NULL
  • expires_at — datetime — NOT NULL
  • revoked — tinyint(1) — NOT NULL

revoked_access_tokens

  • id — bigint — Primary key — NOT NULL
  • jti — varchar(36) — NOT NULL
  • expires_at — datetime — NOT NULL

users

  • user_id — bigint — Primary key — NOT NULL
  • github_user_id — varchar(255) — GitHub 고유 ID
  • user_name — varchar(255) — GitHub username
  • avatar_url — varchar(512) — GitHub 프로필 이미지 URL
  • github_installation_id — bigint — GitHub App Installation ID
  • github_user_access_token — text — AES encrypted GitHub App user access token
  • github_user_refresh_token — text — AES encrypted GitHub App user refresh token
  • user_access_token_expires_at — datetime — GitHub App user access token expiration
  • access_token — text — GitHub API 호출용 Access Token(암호화 저장 권장)
  • scope — varchar(255) — 토큰 권한 범위 (예: repo, workflow 등)
  • token_expires_at — datetime — Access Token 만료 시간 (없을 수도 있음)
  • created_at — datetime — NOT NULL — 계정 생성 일시
  • updated_at — datetime — NOT NULL — 계정 수정 일시

webhook_deliveries

  • delivery_id — varchar(64) — Primary key — NOT NULL
  • event_type — varchar(80) — NOT NULL
  • payload — longblob — NOT NULL
  • status — varchar(30) — NOT NULL
  • attempt — int — NOT NULL
  • max_attempts — int — NOT NULL
  • next_attempt_at — datetime
  • lease_owner — varchar(120)
  • lease_until — datetime
  • error_message — text
  • received_at — datetime — NOT NULL
  • processed_at — datetime
  • updated_at — datetime — NOT NULL