ALTER TABLE meeting
  ADD COLUMN IF NOT EXISTS is_quorate BOOLEAN,
  ADD COLUMN IF NOT EXISTS quorum_recorded_at TIMESTAMPTZ,
  ADD COLUMN IF NOT EXISTS quorum_recorded_by BIGINT REFERENCES app_user(id);

UPDATE template_item
   SET content = REPLACE(
         content,
         'Schriftführung: {{secretary_name}}',
         'Schriftführung: {{secretary_name}}
{{quorum_statement}}'
       ),
       version_label = CASE WHEN version_label = 'v1' THEN 'v2' ELSE version_label END,
       updated_at = NOW()
 WHERE category = 'meeting_protocol'
   AND content NOT LIKE '%{{quorum_statement}}%';
