project-knedita/prisma/schema.prisma

30 lines
714 B
Text
Raw Normal View History

2023-06-20 20:05:15 +00:00
// 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(uuid())
displayName String?
username String @unique
email String @unique
password String
posts Post[]
2023-06-20 20:05:15 +00:00
createdAt DateTime @default(now())
}
model Post {
id String @id @default(uuid())
content String
authorId String
author User @relation(fields: [authorId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}