Files
new_vk_parser/db/migrations/004_junk_post_policy.sql
2026-06-15 21:14:07 +05:00

29 lines
949 B
SQL

INSERT INTO app_settings(key, value_json, value_type, title, description, category)
VALUES
('parser_skip_empty_text', 'true'::jsonb, 'bool', 'Skip empty text posts', 'Treat posts without text as junk.', 'Parser')
ON CONFLICT (key) DO NOTHING;
UPDATE app_settings
SET value_json='50'::jsonb,
description='Posts with shorter text are treated as junk.',
updated_at=NOW()
WHERE key='parser_min_text_length'
AND value_json='0'::jsonb;
UPDATE app_settings
SET value_json='false'::jsonb,
description='Keep junk posts in raw_posts instead of dropping them.',
updated_at=NOW()
WHERE key='parser_store_skipped_posts'
AND value_json='true'::jsonb;
UPDATE app_settings
SET description='Treat posts without media as junk.',
updated_at=NOW()
WHERE key='parser_skip_no_media';
UPDATE app_settings
SET description='Treat posts shorter than parser_min_text_length as junk.',
updated_at=NOW()
WHERE key='parser_skip_text_too_short';