This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrations: add shade layers for old maps
- Loading branch information
Moritz Schalk
committed
Aug 8, 2023
1 parent
32e5e98
commit e575763
Showing
3 changed files
with
19 additions
and
1 deletion.
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
1 change: 1 addition & 0 deletions
1
backend/migrations/2023-08-08-200334_add_missing_shade_layers/down.sql
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 @@ | ||
-- This migration can not be undone! |
17 changes: 17 additions & 0 deletions
17
backend/migrations/2023-08-08-200334_add_missing_shade_layers/up.sql
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,17 @@ | ||
INSERT INTO layers (map_id, type, name, is_alternative) | ||
SELECT | ||
maps_without_shade_layer.id AS map_id, | ||
'shade' AS type, -- noqa: RF04 | ||
'Shade Layer' AS name, -- noqa: RF04 | ||
false AS is_alternative | ||
FROM ( | ||
SELECT maps.id AS id | ||
FROM maps | ||
|
||
EXCEPT | ||
|
||
SELECT maps.id | ||
FROM maps | ||
LEFT JOIN layers ON layers.map_id = maps.id | ||
WHERE layers.type = 'shade' | ||
) AS maps_without_shade_layer; |