From dc7a715386f2db060951fa4f5cf2e8655cb1479d Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Tue, 5 Mar 2024 15:10:13 +0200 Subject: [PATCH] Fix: add created at to environment type trends (#6437) Add created_at to environment_type_trends table for easy sorting --------- Signed-off-by: andreas-unleash --- ...1426-add-created-at-environment-type-trends.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/migrations/20240305121426-add-created-at-environment-type-trends.js diff --git a/src/migrations/20240305121426-add-created-at-environment-type-trends.js b/src/migrations/20240305121426-add-created-at-environment-type-trends.js new file mode 100644 index 0000000000..e3129ce7bd --- /dev/null +++ b/src/migrations/20240305121426-add-created-at-environment-type-trends.js @@ -0,0 +1,15 @@ +'use strict'; + +exports.up = function(db, cb) { + db.runSql( + ` + ALTER TABLE IF EXISTS environment_type_trends + ADD COLUMN created_at timestamp default now(); + `, + cb, + ); +}; + +exports.down = function(db, cb) { + db.runSql('ALTER TABLE IF EXISTS environment_type_trends DROP COLUMN IF EXISTS created_at;', cb); +};