File size: 542 Bytes
ebde876
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()