Skip to content

Commit 986d672

Browse files
committed
fix(schema): add openrouter to provider check constraint, unmask key input
The ai_extraction_config table has a CHECK constraint that only allowed openai, anthropic, ollama. Add openrouter via migration 061. Also remove -s flag from API key read so input is visible — easier to verify the key was pasted correctly.
1 parent 183ac57 commit 986d672

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

operator/lib/guided-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ echo ""
371371

372372
API_KEY_STORED=false
373373
while [ "$API_KEY_STORED" = false ]; do
374-
read -sp "${AI_KEY_PROMPT}: " AI_KEY
374+
read -p "${AI_KEY_PROMPT}: " AI_KEY
375375
echo ""
376376

377377
if [ -z "$AI_KEY" ]; then
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- Migration 061: Add openrouter to ai_extraction_config provider check constraint (ADR-800)
2+
3+
ALTER TABLE kg_api.ai_extraction_config
4+
DROP CONSTRAINT IF EXISTS ai_extraction_config_provider_check;
5+
6+
ALTER TABLE kg_api.ai_extraction_config
7+
ADD CONSTRAINT ai_extraction_config_provider_check
8+
CHECK (provider IN ('openai', 'anthropic', 'ollama', 'openrouter'));
9+
10+
-- ===========================================================================
11+
12+
INSERT INTO public.schema_migrations (version, name)
13+
VALUES (61, 'add_openrouter_provider')
14+
ON CONFLICT (version) DO NOTHING;

0 commit comments

Comments
 (0)