Files
new_vk_parser/db/migrations/031_writer_require_producer_name.sql
T
2026-07-18 21:29:05 +05:00

19 lines
878 B
SQL

-- Make producer mention mandatory in every AI writer result.
UPDATE app_settings
SET value_json = to_jsonb(
CASE
WHEN (value_json #>> '{}') LIKE '%explicitly mention producer_name%'
OR (value_json #>> '{}') LIKE '%явно упоминает producer_name%'
THEN value_json #>> '{}'
ELSE replace(
value_json #>> '{}',
'- Each post includes producer_name and producer_tag. producer_name can be a manufacturer, shop, or publishing source.',
'- Each post includes producer_name and producer_tag. producer_name can be a manufacturer, shop, or publishing source.' || E'\n' ||
'- The "text" field for every rewrite must explicitly mention producer_name at least once. Do not satisfy this only through producer_tag, hashtags, notes, or metadata.'
)
END
),
updated_at = NOW()
WHERE key = 'ai_writer_contract';