upd: configurasi desa
Deskripsi: - update table database - seeder configurasi desa NO Issues
This commit is contained in:
@@ -193,7 +193,7 @@ model SuratPelayanan {
|
||||
|
||||
model Configuration {
|
||||
id String @id @default(cuid())
|
||||
category String
|
||||
name String
|
||||
value String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { categoryPelayananSurat } from "@/lib/categoryPelayananSurat";
|
||||
import { confDesa } from "@/lib/configurationDesa";
|
||||
import { prisma } from "@/server/lib/prisma";
|
||||
|
||||
const category = [
|
||||
@@ -51,7 +52,6 @@ const user = [
|
||||
|
||||
(async () => {
|
||||
for (const r of role) {
|
||||
console.log(`Seeding role ${r.name}`)
|
||||
await prisma.role.upsert({
|
||||
where: { id: r.id },
|
||||
create: r,
|
||||
@@ -81,7 +81,7 @@ const user = [
|
||||
console.log(`✅ Category ${c.name} seeded successfully`)
|
||||
}
|
||||
|
||||
for (const cp of categoryPelayananSurat){
|
||||
for (const cp of categoryPelayananSurat) {
|
||||
await prisma.categoryPelayanan.upsert({
|
||||
where: { id: cp.id },
|
||||
create: cp,
|
||||
@@ -91,6 +91,15 @@ const user = [
|
||||
console.log(`✅ Category Pelayanan ${cp.name} seeded successfully`)
|
||||
}
|
||||
|
||||
for (const c of confDesa) {
|
||||
await prisma.configuration.upsert({
|
||||
where: { id: c.id },
|
||||
create: c,
|
||||
update: c
|
||||
})
|
||||
|
||||
console.log(`✅ Configuration ${c.name} seeded successfully`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user