diff --git a/src/migrations/20231103064746-change-request-schedule-change-type.js b/src/migrations/20231103064746-change-request-schedule-change-type.js new file mode 100644 index 0000000000..4f2b794651 --- /dev/null +++ b/src/migrations/20231103064746-change-request-schedule-change-type.js @@ -0,0 +1,22 @@ +'use strict'; + +exports.up = function (db, cb) { + db.runSql(` + ALTER TABLE change_request_schedule + ALTER COLUMN status TYPE text USING status::text; + + COMMIT; + + DROP TYPE IF EXISTS change_request_schedule_status CASCADE + `, cb); +}; + +exports.down = function (db, cb) { + db.runSql(` + CREATE TYPE change_request_schedule_status AS ENUM ('pending', 'failed'); + + ALTER TABLE change_request_schedule + ALTER COLUMN status TYPE change_request_schedule_status USING status::change_request_schedule_status; + + `, cb); +};