Skip to content

Commit 68a7767

Browse files
authored
Fix migration in 20220603081324-add-archive-at-to-feature-toggle.js
Fixes the query so that instead of using the outer join's event e. Use additional check if the toggle was archived using features table's archived flag. Without this its updating the archived_at for all the existing features after migration
1 parent fcbe9fb commit 68a7767

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/migrations/20220603081324-add-archive-at-to-feature-toggle.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ exports.up = function (db, callback) {
1313
AND e.created_at =
1414
(SELECT Max(created_at) date
1515
FROM events
16-
WHERE e.type = 'feature-archived'
17-
AND e.feature_name = f.NAME)) res
16+
WHERE type = 'feature-archived'
17+
AND feature_name = f.NAME
18+
AND f.archived = 't')) res
1819
WHERE res.NAME = f.NAME;
1920
UPDATE features
2021
SET archived_at = Now()

0 commit comments

Comments
 (0)