Files
gochat/backend/migrations/000067_translate_default_custom_priority.up.sql
T

28 lines
856 B
SQL

UPDATE custom_attribute_definitions
SET
attribute_display_name = '自定义优先级',
description = '自定义工单优先级',
attribute_values = '["低", "中", "高"]'::jsonb,
updated_at = CURRENT_TIMESTAMP
WHERE attribute_name = 'custom_priority'
AND attribute_model = 'conversation_attribute'
AND attribute_display_name = 'Custom Priority'
AND description = 'Custom ticket priority'
AND attribute_values = '["Low", "Medium", "High"]'::jsonb;
UPDATE conversations
SET
custom_attributes = jsonb_set(
custom_attributes,
'{custom_priority}',
to_jsonb(
CASE custom_attributes->>'custom_priority'
WHEN 'Low' THEN '低'
WHEN 'Medium' THEN '中'
WHEN 'High' THEN '高'
END
)
),
updated_at = CURRENT_TIMESTAMP
WHERE custom_attributes->>'custom_priority' IN ('Low', 'Medium', 'High');