From 206d0190ff937e7cfebdbe270df67ff72bf2b1e2 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Tue, 7 May 2024 11:38:51 +0300 Subject: [PATCH] feat: create initial stages for features (#6983) We are getting questions from engineers, why I do not see lifecycle. The same will happen with our customers. Now customers will see lifecycle component unified across features. --- .../20240506141345-lifecycle-initial-stage.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/migrations/20240506141345-lifecycle-initial-stage.js 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, + ); +};