Yimaru-BackEnd/db/migrations/000083_scheduled_in_app_notifications.down.sql
2026-06-12 04:57:03 -07:00

11 lines
437 B
SQL

UPDATE scheduled_notifications
SET status = 'cancelled', cancelled_at = CURRENT_TIMESTAMP, updated_at = CURRENT_TIMESTAMP
WHERE channel = 'in_app' AND status IN ('pending', 'processing');
ALTER TABLE scheduled_notifications
DROP CONSTRAINT IF EXISTS scheduled_notifications_channel_check;
ALTER TABLE scheduled_notifications
ADD CONSTRAINT scheduled_notifications_channel_check
CHECK (channel IN ('email', 'sms', 'push'));