Building a REST API with NestJS and Prisma: Authentication
https://www.prisma.io/blog/nestjs-prisma-rest-api-7D056s1BmOL0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
809 B
33 lines
809 B
// 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 = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Article {
|
|
id Int @id @default(autoincrement())
|
|
title String @unique
|
|
description String?
|
|
body String
|
|
published Boolean @default(false)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
author User? @relation(fields: [authorId], references: [id])
|
|
authorId Int?
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
name String?
|
|
email String @unique
|
|
password String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
articles Article[]
|
|
}
|