diff --git a/src/migrations/20240506141345-lifecycle-initial-stage.js b/src/migrations/20240506141345-lifecycle-initial-stage.js new file mode 100644 index 0000000000..53505809d3 --- /dev/null +++ b/src/migrations/20240506141345-lifecycle-initial-stage.js @@ -0,0 +1,19 @@ +exports.up = function(db, cb) { + db.runSql( + ` + INSERT INTO feature_lifecycles (feature, stage, created_at) + SELECT features.name, 'initial', features.created_at + FROM features + LEFT JOIN feature_lifecycles ON features.name = feature_lifecycles.feature + WHERE feature_lifecycles.feature IS NULL; + `, + cb, + ); +} + +exports.down = function(db, cb) { + db.runSql( + ``, + cb, + ); +};