Files
coder/coderd/database/migrations/000368_add_custom_notifications.down.sql
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
709 B
SQL
Raw Normal View History

2025-09-11 15:08:57 +02:00
-- Remove Custom Notification template
DELETE FROM notification_templates WHERE id = '39b1e189-c857-4b0c-877a-511144c18516';
-- Recreate the old enum without 'custom'
CREATE TYPE old_notification_template_kind AS ENUM ('system');
-- Update notification_templates to use the old enum
ALTER TABLE notification_templates
ALTER COLUMN kind DROP DEFAULT,
ALTER COLUMN kind TYPE old_notification_template_kind USING (kind::text::old_notification_template_kind),
ALTER COLUMN kind SET DEFAULT 'system'::old_notification_template_kind;
-- Drop the current enum and restore the original name
DROP TYPE notification_template_kind;
ALTER TYPE old_notification_template_kind RENAME TO notification_template_kind;