tambahan
This commit is contained in:
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user