Spaces:
Paused
Paused
Download scripts/update-credits.ts from veltrixcode/retest: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/spaces/veltrixcode/retest/resolve/main/scripts/update-credits.ts
- Command line
-
hf download hf://spaces/veltrixcode/retest/scripts/update-credits.ts
-
curl -L -o update-credits.ts https://huggingface.co/spaces/veltrixcode/retest/resolve/main/scripts/update-credits.ts
542 Bytes
| import { PrismaClient } from "@prisma/client" | |
| const prisma = new PrismaClient() | |
| async function main() { | |
| console.log("Starting credit migration...") | |
| try { | |
| const result = await prisma.user.updateMany({ | |
| data: { | |
| credits: 100 | |
| } | |
| }) | |
| console.log(`Successfully updated credits for ${result.count} users.`) | |
| } catch (error) { | |
| console.error("Error updating credits:", error) | |
| process.exit(1) | |
| } finally { | |
| await prisma.$disconnect() | |
| } | |
| } | |
| main() | |