Files
Memoh/db/migrations/0030_drop_tts_model_unique.up.sql
T
Acbox a04b8fd564 refactor: unify providers and models tables
- Rename `llm_providers` → `providers`, `llm_provider_oauth_tokens` → `provider_oauth_tokens`
- Remove `tts_providers` and `tts_models` tables; speech models now live in the unified `models` table with `type = 'speech'`
- Replace top-level `api_key`/`base_url` columns with a JSONB `config` field on `providers`
- Rename `llm_provider_id` → `provider_id` across all references
- Add `edge-speech` client type and `conf/providers/edge.yaml` default provider
- Create new read-only speech endpoints (`/speech-providers`, `/speech-models`) backed by filtered views of the unified tables
- Remove old TTS CRUD handlers; simplify speech page to read-only + test
- Update registry loader to skip malformed YAML files instead of failing entirely
- Fix YAML quoting for model names containing colons in openrouter.yaml
- Regenerate sqlc, swagger, and TypeScript SDK
2026-04-07 00:26:06 +08:00

12 lines
459 B
SQL

-- 0030_drop_tts_model_unique
-- Drop unique constraint on (tts_provider_id, model_id) to allow multiple
-- models with the same model_id under one provider (different configs).
-- NOTE: No-op on fresh databases where tts_models no longer exists.
DO $$
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'tts_models') THEN
ALTER TABLE tts_models DROP CONSTRAINT IF EXISTS tts_models_provider_model_id_unique;
END IF;
END $$;