From 9e1241d72839f8a6c1a2e06282d3e1c74cfd909c Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Wed, 19 Apr 2023 10:07:56 +0300 Subject: [PATCH] fix: migration (#3558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes `down` migration for add_title_to_strategy ## About the changes Closes # ### Important files ## Discussion points Signed-off-by: andreas-unleash --- src/migrations/20230412125618-add-title-to-strategy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/migrations/20230412125618-add-title-to-strategy.js b/src/migrations/20230412125618-add-title-to-strategy.js index 1f4e9aba58..5149d774dd 100644 --- a/src/migrations/20230412125618-add-title-to-strategy.js +++ b/src/migrations/20230412125618-add-title-to-strategy.js @@ -45,8 +45,6 @@ exports.up = function (db, callback) { exports.down = function (db, callback) { db.runSql( ` - ALTER TABLE strategies DROP COLUMN IF EXISTS title; - ALTER TABLE feature_strategies DROP COLUMN IF EXISTS title; DROP VIEW features_view; CREATE VIEW features_view AS SELECT @@ -78,6 +76,9 @@ exports.down = function (db, callback) { and feature_strategies.environment = feature_environments.environment LEFT JOIN environments ON feature_environments.environment = environments.name LEFT JOIN feature_strategy_segment as fss ON fss.feature_strategy_id = feature_strategies.id; + + ALTER TABLE strategies DROP COLUMN IF EXISTS title; + ALTER TABLE feature_strategies DROP COLUMN IF EXISTS title; `, callback, );