Skip to content

Commit

Permalink
Update sql schema (#17)
Browse files Browse the repository at this point in the history
* Update sql schema

* remove salt
  • Loading branch information
likui628 authored Sep 30, 2024
1 parent c5297ba commit fff04bd
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,37 @@ datasource db {
}

model User {
id String @id @default(uuid())
email String @unique
id String @id @default(uuid())
email String @unique
name String?
password String
role Role? @default(USER)
role Role? @default(USER)
isVerified Boolean
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tokens Token[] @relation("userTokens")
}

model Token {
token String @id
userId String
type TokenType
expires DateTime
isBlocked Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation("userTokens", fields: [userId], references: [id])
}

enum Role {
USER
ADMIN
}

enum TokenType {
REFRESH
RESET_PASSWORD
VERIFY_EMAIL
}

0 comments on commit fff04bd

Please sign in to comment.