generated from MapColonies/ts-server-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added is latest * refactor: change let to const * docs: added comment explaining when previous config is marked as not latest
- Loading branch information
1 parent
0a43baa
commit 29eb92b
Showing
9 changed files
with
233 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
ALTER TABLE "config_server"."config" | ||
ADD COLUMN "is_latest" boolean; | ||
|
||
UPDATE "config_server"."config" | ||
SET | ||
"is_latest" = CASE | ||
WHEN "version" = ( | ||
SELECT | ||
max(VERSION) | ||
FROM | ||
"config_server"."config" AS sub | ||
WHERE | ||
sub.name = "config"."name" | ||
) THEN TRUE | ||
ELSE FALSE | ||
END; | ||
|
||
ALTER TABLE "config_server"."config" | ||
ALTER COLUMN "is_latest" | ||
SET NOT NULL; |
Oops, something went wrong.