fix: sync canonical schema with 0061 migration to fix sqlc column mismatch

0001_init.up.sql still used old names (llm_providers, llm_provider_id)
and included dropped tts_providers/tts_models tables. sqlc could not
parse the PL/pgSQL EXECUTE in migration 0061, so generated code retained
stale columns (input_modalities, supports_reasoning) causing runtime
"column does not exist" errors when adding models.

- Update 0001_init.up.sql to current schema (providers, provider_id,
  no tts tables, add provider_oauth_tokens)
- Use ALTER TABLE IF EXISTS in 0010/0041/0042 for backward compat
- Regenerate sqlc
This commit is contained in:
Acbox
2026-04-08 00:45:06 +08:00
parent b71df81d5c
commit 889b6dbaa4
6 changed files with 109 additions and 126 deletions
@@ -1,8 +1,8 @@
-- 0041_provider_model_refactor
-- Move client_type to llm_providers, add icon, replace model columns with config JSONB.
-- 1. Add client_type and icon to llm_providers
ALTER TABLE llm_providers
-- 1. Add client_type and icon to llm_providers (IF EXISTS for fresh-schema compat)
ALTER TABLE IF EXISTS llm_providers
ADD COLUMN IF NOT EXISTS client_type TEXT NOT NULL DEFAULT 'openai-completions',
ADD COLUMN IF NOT EXISTS icon TEXT;