From 25dad235f99f3561cff3d78ef98cd1b0ccd59740 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Tue, 19 Nov 2024 12:11:25 +0100 Subject: [PATCH] 1-3131: set default to non-nullable --- .../20241119103819-make-potentially-stale-non-nullable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/migrations/20241119103819-make-potentially-stale-non-nullable.js b/src/migrations/20241119103819-make-potentially-stale-non-nullable.js index 46f8d9dee340..68e3e3b1f3be 100644 --- a/src/migrations/20241119103819-make-potentially-stale-non-nullable.js +++ b/src/migrations/20241119103819-make-potentially-stale-non-nullable.js @@ -7,6 +7,8 @@ exports.up = function (db, cb) { SET potentially_stale = FALSE WHERE potentially_stale IS NULL; + ALTER TABLE features + ALTER COLUMN potentially_stale SET DEFAULT FALSE; ALTER TABLE features ALTER COLUMN potentially_stale SET NOT NULL; `, @@ -18,8 +20,10 @@ exports.down = function (db, cb) { db.runSql( ` ALTER TABLE features + ALTER COLUMN potentially_stale DROP DEFAULT; + ALTER TABLE features ALTER COLUMN potentially_stale DROP NOT NULL; `, cb ); -}; \ No newline at end of file +};