church-api/check_specific_bulletin.sql
Benjamin Slingo 0c06e159bb Initial commit: Church API Rust implementation
Complete church management system with bulletin management, media processing, live streaming integration, and web interface. Includes authentication, email notifications, database migrations, and comprehensive test suite.
2025-08-19 20:56:41 -04:00

25 lines
1.1 KiB
SQL

-- Check the specific bulletin that the API is returning
SELECT id, title, date,
length(scripture_reading) as scripture_length,
substring(scripture_reading, 1, 200) as scripture_sample,
CASE WHEN scripture_reading LIKE '%<%' THEN 'HAS HTML' ELSE 'CLEAN' END as has_html
FROM bulletins
WHERE id = '192730b5-c11c-4513-a37d-2a8b320136a4';
-- Let's also clean this specific record if it has HTML
UPDATE bulletins
SET scripture_reading = REGEXP_REPLACE(scripture_reading, '<[^>]*>', '', 'g'),
sabbath_school = REGEXP_REPLACE(COALESCE(sabbath_school, ''), '<[^>]*>', '', 'g'),
divine_worship = REGEXP_REPLACE(COALESCE(divine_worship, ''), '<[^>]*>', '', 'g'),
sunset = REGEXP_REPLACE(COALESCE(sunset, ''), '<[^>]*>', '', 'g')
WHERE id = '192730b5-c11c-4513-a37d-2a8b320136a4'
AND (scripture_reading LIKE '%<%'
OR sabbath_school LIKE '%<%'
OR divine_worship LIKE '%<%'
OR sunset LIKE '%<%');
-- Verify after cleaning
SELECT 'After targeted cleaning:' as status;
SELECT substring(scripture_reading, 1, 200) as cleaned_content
FROM bulletins
WHERE id = '192730b5-c11c-4513-a37d-2a8b320136a4';