1

我在 nestjs/prima/postegre 项目中工作,我找不到任何类似的代码源资源,我如何更新我的 prisma 模式以适应 SCIM 模型,或者是否有任何类似的项目可以激发灵感?

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
  previewFeatures = ["filterJson"]
  // previewFeatures = []
}

generator dbml {
  provider = "prisma-dbml-generator"
}

model User {
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  email     String   @unique
  password  String
  firstname String?
  lastname  String?
  posts     Post[]
  role      Role
}

model Post {
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  published Boolean
  title     String
  content   String?
  author    User?    @relation(fields: [authorId], references: [id])
  authorId  String?
}

enum Role {
  ADMIN
  USER
}
4

0 回答 0