1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

chore: remove enum type from db (#5254)

Changes the change_request_schedule `status` column to text. 
Drops the custom type

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2023-11-03 09:28:19 +02:00 committed by GitHub
parent ba9a217e8f
commit 95245c4413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
};