fix: 减少自定义情景中数据库表对 prompt 的约束
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- 005_fix_user_scenarios_description.down.sql
|
||||
-- 回滚:恢复原约束(description 必填,prompt 最小长度 50)
|
||||
|
||||
-- 注意:如果表中存在不符合原约束的数据,此回滚会失败
|
||||
|
||||
-- 1. 恢复 description 为必填
|
||||
ALTER TABLE user_scenarios
|
||||
ALTER COLUMN description SET NOT NULL;
|
||||
|
||||
-- 2. 恢复 prompt 最小长度为 50
|
||||
ALTER TABLE user_scenarios
|
||||
DROP CONSTRAINT IF EXISTS check_prompt_length;
|
||||
|
||||
ALTER TABLE user_scenarios
|
||||
ADD CONSTRAINT check_prompt_length CHECK (char_length(prompt) >= 50 AND char_length(prompt) <= 2000);
|
||||
Reference in New Issue
Block a user