From 7fab35a461d8ae38274050df04046ebb63fe7140 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 14 Jan 2023 14:43:14 +0200 Subject: [PATCH] Fix seed script --- app/db/seed.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/db/seed.ts b/app/db/seed.ts index 34f86e4b9..f2d2689ff 100644 --- a/app/db/seed.ts +++ b/app/db/seed.ts @@ -42,6 +42,7 @@ const basicSeeds = [ users, userProfiles, lastMonthsVoting, + syncPlusTiers, lastMonthSuggestions, thisMonthsSuggestions, badgesToAdmin, @@ -83,8 +84,8 @@ function wipeDB() { "CalendarEventBadge", "CalendarEvent", "UserWeapon", + "PlusTier", "User", - "PlusVote", "PlusSuggestion", "PlusVote", "TournamentBadgeOwner", @@ -299,6 +300,16 @@ function thisMonthsSuggestions() { } } +function syncPlusTiers() { + sql + .prepare( + /* sql */ ` + insert into "PlusTier" ("userId", "tier") select "userId", "tier" from "FreshPlusTier" where "tier" is not null; + ` + ) + .run(); +} + function badgesToAdmin() { const availableBadgeIds = shuffle( sql