This commit is contained in:
2026-06-02 10:23:09 +03:00
parent e08d555b23
commit 0c87eaef46
136 changed files with 16069 additions and 94 deletions

28
prisma/seed.ts Normal file
View File

@@ -0,0 +1,28 @@
import { PrismaClient } from "@prisma/client";
import { hashPassword } from "../lib/crypto";
const prisma = new PrismaClient();
async function main() {
const email = process.env.ADMIN_EMAIL ?? "jaradatgamer@gmail.com";
const password = process.env.ADMIN_PASSWORD ?? "admin123";
const passwordHash = await hashPassword(password);
await prisma.user.upsert({
where: { email },
update: {},
create: { email, passwordHash },
});
console.log(`Seeded admin user: ${email}`);
}
main()
.catch((e) => {
console.error(e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});