-- notification.recipient is now a checkbox field (JSON array of one or more
-- recipient keys) instead of a single select value, and code no longer
-- falls back to a hardcoded recipient when a template's own recipient isn't
-- set — queueNotification() only sends to whatever is configured here. This
-- backfills the existing seeded templates to match the recipient they were
-- previously hardcoded to in PHP, so behavior is unchanged for them.
--
-- Apply to every environment's database before deploying this change.

UPDATE `notification` SET `recipient` = '["student"]' WHERE `name` IN ('confirmation', 'confirmation_level_2', 'reminder_template');
UPDATE `notification` SET `recipient` = '["organization_email"]' WHERE `name` = 'administrator_notification';
UPDATE `notification` SET `recipient` = '["organization_email_level_2"]' WHERE `name` = 'administrator_notification_level_2';
UPDATE `notification` SET `recipient` = '["student", "student_file_email"]' WHERE `name` = 'decision_letter_template';
