nest-autocrud/prisma/schema.prisma

35 lines
879 B
Plaintext
Raw Normal View History

2024-10-26 12:17:58 +00:00
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
2024-10-26 13:01:34 +00:00
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
2024-10-26 12:17:58 +00:00
}
datasource db {
2024-10-26 13:01:34 +00:00
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [pgcrypto]
}
model User {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
username String @unique
name String
Todo Todo[]
2024-10-26 13:01:34 +00:00
@@map("account")
2024-10-26 12:17:58 +00:00
}
model Todo {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
name String
user User @relation(fields: [userId], references: [id])
userId String @map("user_id") @db.Uuid
@@map("todo")
}