fix(rag): add the diagnosis column to existing hitl_messages tables

첫 이미지(f30af2a)가 만든 ai.hitl_messages에는 diagnosis 컬럼이 없어 /post의 insert가
42703으로 실패했다(실측). CREATE TABLE IF NOT EXISTS는 기존 테이블을 바꾸지 않으므로
ADD COLUMN IF NOT EXISTS를 스키마 적용 단계에 추가한다.
This commit is contained in:
seon committed 2026-10-08 02:33:54 +09:00
1 parent 683a2de530
commit 9bc3a3b5fe
1 file changed
+3 -1
+3 -1
View File
@@ -67,7 +67,9 @@ CREATE TABLE IF NOT EXISTS ai.hitl_messages (
decided_by text, decided_by text,
result jsonb, result jsonb,
created_at timestamptz NOT NULL DEFAULT now() created_at timestamptz NOT NULL DEFAULT now()
);` );
-- additive migrations (CREATE TABLE IF NOT EXISTS leaves existing tables untouched; seen 2026-10-08 on the AI VM)
ALTER TABLE ai.hitl_messages ADD COLUMN IF NOT EXISTS diagnosis jsonb NOT NULL DEFAULT '{}'::jsonb;`
func New(ctx context.Context, dsn string) (*Store, error) { func New(ctx context.Context, dsn string) (*Store, error) {
pool, err := pgxpool.New(ctx, dsn) pool, err := pgxpool.New(ctx, dsn)