Clean up notification type enum and add SCRIPT

This commit is contained in:
Magnus Åhall 2024-06-02 10:10:14 +02:00
parent b83adad7c8
commit 4a52c319c4

9
sql/00016.sql Normal file
View File

@ -0,0 +1,9 @@
ALTER TYPE notification_type RENAME TO _notification_type;
CREATE TYPE notification_type AS ENUM ('NTFY', 'SCRIPT');
ALTER TABLE notification RENAME COLUMN service TO _service;
ALTER TABLE notification ADD service notification_type NOT NULL DEFAULT 'NTFY';
UPDATE notification SET service = _service::text::notification_type;
ALTER TABLE notification DROP COLUMN _service;
DROP TYPE _notification_type;