gitdataai/libs/migrate/sql/m20260508_000007_create_project_context_setting.sql
ZhenYi b1ef024724 fix(migrate): reorder create_project before add_workspace_id_to_project and remove foreign keys
- Move create_project migration before add_workspace_id_to_project so the
  project table exists when workspace_id column is added
- Remove all FOREIGN KEY constraints from migration SQL files
2026-05-11 01:31:33 +08:00

15 lines
645 B
SQL

CREATE TABLE IF NOT EXISTS project_context_setting (
project_id UUID PRIMARY KEY,
context_window_tokens INT NOT NULL DEFAULT 128000,
compaction_threshold FLOAT NOT NULL DEFAULT 0.8,
compaction_max_summary_ratio FLOAT NOT NULL DEFAULT 0.2,
rag_enabled BOOLEAN NOT NULL DEFAULT true,
rag_cross_session BOOLEAN NOT NULL DEFAULT true,
rag_max_results INT NOT NULL DEFAULT 10,
rag_min_score FLOAT NOT NULL DEFAULT 0.5,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_proj_ctx_rag_enabled ON project_context_setting (rag_enabled);