From 8ea034cc2f4ab39d722f48bbe8245c06be6157b7 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Thu, 9 May 2024 09:39:01 +0300 Subject: [PATCH] feat: add status fields for feature lifecycle table (#7014) --- .../feature-lifecycle/feature-lifecycle-store.ts | 2 ++ .../20240508153244-feature-lifecycles-status.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/migrations/20240508153244-feature-lifecycles-status.js diff --git a/src/lib/features/feature-lifecycle/feature-lifecycle-store.ts b/src/lib/features/feature-lifecycle/feature-lifecycle-store.ts index 2eedea9844..6893ca8434 100644 --- a/src/lib/features/feature-lifecycle/feature-lifecycle-store.ts +++ b/src/lib/features/feature-lifecycle/feature-lifecycle-store.ts @@ -10,6 +10,8 @@ import type { StageName } from '../../types'; type DBType = { stage: StageName; created_at: string; + status?: string; + status_value?: string; }; type DBProjectType = DBType & { diff --git a/src/migrations/20240508153244-feature-lifecycles-status.js b/src/migrations/20240508153244-feature-lifecycles-status.js new file mode 100644 index 0000000000..8f2c5b74f0 --- /dev/null +++ b/src/migrations/20240508153244-feature-lifecycles-status.js @@ -0,0 +1,16 @@ +exports.up = function (db, cb) { + db.runSql(` + ALTER TABLE feature_lifecycles ADD COLUMN IF NOT EXISTS status TEXT; + ALTER TABLE feature_lifecycles ADD COLUMN IF NOT EXISTS status_value TEXT; + `, cb); +}; + +exports.down = function (db, cb) { + db.runSql( + ` + ALTER TABLE feature_lifecycles DROP COLUMN IF EXISTS status; + ALTER TABLE feature_lifecycles DROP COLUMN IF EXISTS status_value; + `, + cb, + ); +};