-- =============================================================
-- V025: Backfill proposed_by_external_user_id for Telegram proposals
-- =============================================================
-- Scope: Ensure all reschedule_proposals have proposed_by_external_user_id
-- populated so that InitiateRescheduleHandler can stop writing proposed_by.
-- =============================================================

UPDATE reschedule_proposals
   SET proposed_by_external_user_id = proposed_by::TEXT
 WHERE proposed_by_external_user_id IS NULL
   AND proposed_by IS NOT NULL;
