From 4a52c319c43e7acc444d9489f2c19c3bbd333c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Sun, 2 Jun 2024 10:10:14 +0200 Subject: [PATCH] Clean up notification type enum and add SCRIPT --- sql/00016.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/00016.sql diff --git a/sql/00016.sql b/sql/00016.sql new file mode 100644 index 0000000..9f9aad5 --- /dev/null +++ b/sql/00016.sql @@ -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;