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, + ); +};