Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637import { PrismaClient } from "@prisma/client";import bcrypt from "bcryptjs";
const email = process.argv[2];const password = process.argv[3];
async function main() { const prisma = new PrismaClient({ datasources: { db: { url: process.env.DATABASE_URL } }, }); await prisma.$connect();
const hashedPassword = await bcrypt.hash(password, 10);
await prisma.admin.create({ data: { email, password: { create: { hash: hashedPassword, }, }, }, });
console.log("✅ all finished");
await prisma.$disconnect();}
main().catch((e) => { console.error(e); process.exit(1);});
export {};