1
0

Accounts system, no RBAC yet

This commit is contained in:
Ahmed Al-Taiar
2023-10-31 18:41:57 -04:00
parent 1eaf76fce2
commit fcdacd844f
23 changed files with 1112 additions and 60 deletions

View File

@@ -16,3 +16,26 @@ model Part {
imageUrl String @default("/no_image.png")
createdAt DateTime @default(now())
}
model User {
id Int @id @default(autoincrement())
firstName String
lastName String
email String @unique
hashedPassword String
salt String
resetToken String?
resetTokenExpiresAt DateTime?
userRoles UserRole[]
}
model UserRole {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
name String
user User? @relation(fields: [userId], references: [id])
userId Int?
@@unique([name, userId])
}