Desc: - Perubahan pengambilan data dari API ke Function use server No issue
94 lines
2.8 KiB
Plaintext
94 lines
2.8 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
username String @unique
|
|
nomor String @unique
|
|
active Boolean @default(true)
|
|
createdAt DateTime? @default(now())
|
|
updatedAt DateTime? @updatedAt
|
|
MasterUserRole MasterUserRole @relation(fields: [masterUserRoleId], references: [id])
|
|
masterUserRoleId String @default("1")
|
|
UserSession UserSession?
|
|
Profile Profile?
|
|
}
|
|
|
|
model MasterUserRole {
|
|
id String @id
|
|
name String
|
|
active Boolean @default(true)
|
|
createdAt DateTime? @default(now())
|
|
updatedAt DateTime? @updatedAt
|
|
User User[]
|
|
}
|
|
|
|
model UserSession {
|
|
id String @id @default(cuid())
|
|
token String
|
|
expires DateTime
|
|
active Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
User User @relation(fields: [userId], references: [id])
|
|
userId String @unique
|
|
}
|
|
|
|
model Profile {
|
|
id String @id @default(cuid())
|
|
name String
|
|
email String @unique
|
|
alamat String
|
|
jenisKelamin String
|
|
active Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
User User? @relation(fields: [userId], references: [id])
|
|
userId String? @unique
|
|
ImageProfile Images? @relation(fields: [imagesId], references: [id])
|
|
imagesId String? @unique
|
|
Katalog Katalog[]
|
|
}
|
|
|
|
model Images {
|
|
id String @id @default(cuid())
|
|
url String
|
|
active Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
Profile Profile?
|
|
}
|
|
|
|
model Katalog {
|
|
id String @id @default(cuid())
|
|
namaBisnis String
|
|
alamatKantor String
|
|
tlpn String
|
|
deskripsi String
|
|
active Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
Profile Profile? @relation(fields: [profileId], references: [id])
|
|
profileId String?
|
|
MasterBidangBisnis MasterBidangBisnis @relation(fields: [masterBidangBisnisId], references: [id])
|
|
masterBidangBisnisId String
|
|
}
|
|
|
|
model MasterBidangBisnis {
|
|
id String @id
|
|
name String
|
|
active Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
Katalog Katalog[]
|
|
}
|