Files
JuYou/API/migrations/000039_remove_text_output_limit.up.sql
2026-08-25 17:59:42 +08:00

11 lines
370 B
PL/PgSQL

BEGIN;
ALTER TABLE models DROP CONSTRAINT IF EXISTS models_text_billing_mode_check;
ALTER TABLE models DROP COLUMN IF EXISTS max_output_tokens;
ALTER TABLE models ADD CONSTRAINT models_text_billing_mode_check CHECK (
(model_type = 'text' AND text_billing_mode IN ('per_request', 'per_token'))
OR (model_type <> 'text' AND text_billing_mode IS NULL)
);
COMMIT;