-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate existing mods to use targets
- Loading branch information
1 parent
7d39754
commit 6d7c4f3
Showing
4 changed files
with
31 additions
and
2 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
15 changes: 15 additions & 0 deletions
15
migrations/sql/000023_migrate_versions_to_targets.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,15 @@ | ||
--Mod Targets-- | ||
DELETE FROM version_targets | ||
USING versions | ||
WHERE version_targets.version_id = versions.id AND | ||
version_targets.target_name = 'Windows' AND | ||
version_targets.key = versions.key AND | ||
version_targets.hash = versions.hash AND | ||
version_targets.size = versions.size; | ||
|
||
--SML Targets-- | ||
DELETE FROM sml_version_targets | ||
USING sml_versions | ||
WHERE sml_version_targets.version_id = sml_versions.id AND | ||
sml_version_targets.target_name = 'Windows' AND | ||
sml_version_targets.link = replace(sml_versions.link, '/tag/', '/download/') || '/SML.zip'; |
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,10 @@ | ||
-- Mod Targets -- | ||
INSERT INTO version_targets (version_id, target_name, key, hash, size) | ||
SELECT id, 'Windows', key, hash, size | ||
FROM versions; | ||
|
||
-- SML Targets -- | ||
INSERT INTO sml_version_targets (version_id, target_name, link) | ||
SELECT id, 'Windows', replace(link, '/tag/', '/download/') || '/SML.zip' | ||
FROM sml_versions | ||
WHERE version LIKE '3%'; |