-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
41 lines (35 loc) · 1009 Bytes
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// 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 {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
username String @unique
email String @unique
emailApproved Boolean @default(false)
password String
role Int @default(1)
createdAt DateTime @default(now())
emailApproveCodes ApproveEmail[]
}
model ApproveEmail {
id Int @id @default(autoincrement())
key String @db.VarChar(255)
user User @relation(fields: [userId], references: [id])
userId Int
}
model Book {
id Int @id @default(autoincrement())
title String
author String
publicationDate DateTime
genres String[]
createdAt DateTime @default(now())
}