mysociety/za-hansard — pull request #19 by osfameron (2013-11-14 17:10:22+00:00)
Title: Parse questions with "Questions asked to"

fixes mysociety/pombola/issues/807

To avoid re-parsing all existing quesions, can run the following (one-off) SQL:

update speeches_section
set title = 'Questions asked to ' || speeches_section.title
from speeches_section child_section
join speeches_speech on speeches_speech.section_id = child_section.id
join speeches_speech_tags on speeches_speech_tags.speech_id = speeches_speech.id
join speeches_tag on speeches_speech_tags.tag_id = speeches_tag.id
where child_section.parent_id = speeches_section.id
and speeches_tag.name = 'question';