The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
update backfill scripts
Kiran K0f892061dca5
diff --git a/apps/web/scripts/migrations/backfill-bounties.ts b/apps/web/scripts/migrations/backfill-bounties.tsindex dce6ec7ef2..47a426af35 100644--- a/apps/web/scripts/migrations/backfill-bounties.ts+++ b/apps/web/scripts/migrations/backfill-bounties.ts@@ -1,8 +1,10 @@-import { prisma } from "@dub/prisma";import "dotenv-flow/config";+import { qstash } from "@/lib/cron";+import { prisma } from "@dub/prisma";+import { APP_DOMAIN_WITH_NGROK } from "@dub/utils";async function main() {- // All existing performance bounties should be all-time stats+ // Step 1: Set all existing performance bounties to all-time statsawait prisma.bounty.updateMany({where: {type: "performance",@@ -11,6 +13,26 @@ async function main() {currentStatsOnly: false,},});++ const bounties = await prisma.bounty.findMany({+ where: {+ type: "performance",+ },+ });++ // Step 2: Create the draft bounty submission for performance bounties+ for (const bounty of bounties) {+ qstash.publishJSON({+ url: `${APP_DOMAIN_WITH_NGROK}/api/cron/bounties/create-draft-submissions`,+ body: {+ bountyId: bounty.id,+ },+ });++ console.log(+ `Enqueued /api/cron/bounties/create-draft-submissions for the bounty ${bounty.id}`,+ );+ }}main();