This commit is contained in:
bipproduction
2025-10-28 15:12:58 +08:00
parent 78b1c0ee2d
commit 65b24ab031

View File

@@ -17,6 +17,7 @@ const role = [
const user = [ const user = [
{ {
id: "bip",
name: "Bip", name: "Bip",
email: "bip@bip.com", email: "bip@bip.com",
password: "bip", password: "bip",
@@ -25,16 +26,6 @@ const user = [
]; ];
(async () => { (async () => {
for (const u of user) {
await prisma.user.upsert({
where: { email: u.email },
create: u,
update: u
})
console.log(`✅ User ${u.email} seeded successfully`)
}
for (const r of role) { for (const r of role) {
console.log(`Seeding role ${r.name}`) console.log(`Seeding role ${r.name}`)
await prisma.role.upsert({ await prisma.role.upsert({
@@ -45,6 +36,18 @@ const user = [
console.log(`✅ Role ${r.name} seeded successfully`) console.log(`✅ Role ${r.name} seeded successfully`)
} }
for (const u of user) {
await prisma.user.upsert({
where: { email: u.email },
create: u,
update: u
})
console.log(`✅ User ${u.email} seeded successfully`)
}
})().catch((e) => { })().catch((e) => {