baru ni e
This commit is contained in:
48
prisma/schema.prisma
Normal file
48
prisma/schema.prisma
Normal file
@@ -0,0 +1,48 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
output = "../generated/prisma"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
name String?
|
||||
email String? @unique
|
||||
password String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
ApiKey ApiKey[]
|
||||
configs Configs? @relation(fields: [configsId], references: [id])
|
||||
configsId String?
|
||||
role USER_ROLE @default(USER)
|
||||
active Boolean @default(true)
|
||||
}
|
||||
|
||||
model ApiKey {
|
||||
id String @id @default(cuid())
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String
|
||||
name String
|
||||
key String @unique @db.Text
|
||||
description String?
|
||||
expiredAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Configs {
|
||||
id String @id @default("1")
|
||||
allowRegister Boolean @default(false)
|
||||
imamKey String @default("imam_key")
|
||||
ikomahKey String @default("ikomah_key")
|
||||
selectedUser User[]
|
||||
}
|
||||
|
||||
enum USER_ROLE {
|
||||
ADMIN
|
||||
USER
|
||||
}
|
||||
Reference in New Issue
Block a user