From 64b00fa52d11ab645cf9d6135277ffb6c6103ac8 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Thu, 3 Aug 2023 11:22:35 +0200 Subject: [PATCH] feat: optional change request feature (#4394) --- ...3061359-change-request-optional-feature.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/migrations/20230803061359-change-request-optional-feature.js diff --git a/src/migrations/20230803061359-change-request-optional-feature.js b/src/migrations/20230803061359-change-request-optional-feature.js new file mode 100644 index 0000000000..8ab6268c66 --- /dev/null +++ b/src/migrations/20230803061359-change-request-optional-feature.js @@ -0,0 +1,20 @@ +'use strict'; + +exports.up = function (db, callback) { + db.runSql( + ` + ALTER TABLE change_request_events ALTER COLUMN feature DROP NOT NULL; + `, + callback, + ); +}; + +exports.down = function (db, callback) { + db.runSql( + ` + DELETE FROM change_request_events WHERE feature IS NULL; + ALTER TABLE change_request_events ALTER COLUMN feature SET NOT NULL; + `, + callback, + ); +};