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;