Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/scripts/copy-prod-db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,21 @@ async function main() {
-- Update DiscordClubMetadata for 'MHC++'
UPDATE \"DiscordClubMetadata\" m
SET
SET
\"guildId\" = '1389762654452580373',
\"leaderboardChannelId\" = '1401739528057655436'
FROM \"DiscordClub\" c
WHERE c.\"id\" = m.\"discordClubId\"
AND c.\"name\" = 'MHC++';
-- Update DiscordClubMetadata for 'GWC - Hunter College'
UPDATE \"DiscordClubMetadata\" m
SET
\"guildId\" = '1389762654452580373',
\"leaderboardChannelId\" = '1401739528057655436'
FROM \"DiscordClub\" c
WHERE c.\"id\" = m.\"discordClubId\"
AND c.\"name\" = 'GWC - Hunter College';
"`;

await sendMessage(prId, `Database copy command completed successfully!`);
Expand Down
46 changes: 46 additions & 0 deletions db/migration/V0072__Add_gwc_hunter_to_discord_club.SQL
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
INSERT INTO "DiscordClub"
(id, name, description, tag)
VALUES
(gen_random_uuid(), 'GWC - Hunter College', NULL, 'Gwc');


DO $$
BEGIN
CASE current_database()
WHEN 'codebloom-prod' THEN
WITH CLUB AS (
SELECT
*
FROM
"DiscordClub"
WHERE
name = 'GWC - Hunter College'
)
INSERT INTO "DiscordClubMetadata"
(id, "guildId", "leaderboardChannelId", "discordClubId")
SELECT
gen_random_uuid(),
'1066177903345278986',
'1468417251274129452',
CLUB.id
FROM CLUB;

ELSE
WITH CLUB AS (
SELECT
*
FROM
"DiscordClub"
WHERE
name = 'GWC - Hunter College'
)
INSERT INTO "DiscordClubMetadata"
(id, "guildId", "leaderboardChannelId", "discordClubId")
SELECT
gen_random_uuid(),
'1389762654452580373',
'1417161536014778388',
CLUB.id
FROM CLUB;
END CASE;
END $$;
5 changes: 3 additions & 2 deletions js/src/lib/api/utils/metadata/tag/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const TAG_METADATA_LIST: Record<Tag, ApiTypeUtils.TagMetadata> = {
alt: "Patina Logo",
},
Gwc: {
shortName: "GWC @ Hunter",
name: "Hunter College - GWC",
shortName: "GWC - Hunter College",
name: "GWC - Hunter College",
apiKey: "gwc",
icon: "/brands/Gwc_Logo.png",
alt: "GWC Logo",
Expand Down Expand Up @@ -96,4 +96,5 @@ export const NON_SCHOOL_TAGS: Tag[] = [
...UNUSED_TAGS,
Tag.Patina,
Tag.MHCPlusPlus,
Tag.Gwc,
];
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public void generateAchievementsForAllWinners() {
List<UserWithScore> winners = usersWithPoints.subList(0, maxWinners(usersWithPoints.size()));

for (int i = 0; i < winners.size(); i++) {
UserWithScore user = winners.get(i);
int place = i + 1;
log.info("on leaderboard for {} for winner #{}", pair.getRight().getResolvedName(), place);
String placeString = calculatePlaceString(place);
UserWithScore user = winners.get(i);
Achievement achievement = Achievement.builder()
.userId(user.getId())
.place(AchievementPlaceEnum.fromInteger(place))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum Tag {
Nyu("New York University"),
Baruch("Baruch College"),
Rpi("Rensselaer Polytechnic Institute"),
Gwc(null),
Gwc("GWC - Hunter College"),
Sbu("Stony Brook University"),
Ccny("City College of New York"),
Columbia("Columbia University"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public static List<Pair<LeaderboardFilterOptions, Tag>> generateAllSupportedTagT
list.add(Pair.of(withOnlyTrue(opt -> opt.columbia(true)), Tag.Columbia));
list.add(Pair.of(withOnlyTrue(opt -> opt.cornell(true)), Tag.Cornell));
list.add(Pair.of(withOnlyTrue(opt -> opt.bmcc(true)), Tag.Bmcc));
list.add(Pair.of(withOnlyTrue(opt -> opt.bmcc(true)), Tag.MHCPlusPlus));
list.add(Pair.of(withOnlyTrue(opt -> opt.mhcplusplus(true)), Tag.MHCPlusPlus));
list.add(Pair.of(withOnlyTrue(opt -> opt.gwc(true)), Tag.Gwc));

return list;
}
Expand Down
Loading