Skip to content

Commit

Permalink
fix: migration (#3558)
Browse files Browse the repository at this point in the history
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->
Fixes `down` migration  for add_title_to_strategy
## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
  • Loading branch information
andreas-unleash committed Apr 19, 2023
1 parent d10623e commit 9e1241d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/migrations/20230412125618-add-title-to-strategy.js
Expand Up @@ -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
Expand Down Expand Up @@ -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,
);
Expand Down

0 comments on commit 9e1241d

Please sign in to comment.