15ac634d15
- Introduced a `mustResetPassword` field in the User model to manage password reset requirements. - Enhanced authentication flow to support password changes, including validation and error handling. - Updated frontend components to handle password reset scenarios and integrate with the new API endpoints. - Modified authentication context and hooks to accommodate the new password reset logic. - Adjusted E2E tests to ensure proper coverage for the password reset functionality.
61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
// 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"
|
|
output = "../src/generated/client"
|
|
binaryTargets = ["native", "linux-musl-arm64-openssl-3.0.x", "linux-musl-openssl-3.0.x"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Collection {
|
|
id String @id @default(uuid())
|
|
name String
|
|
drawings Drawing[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Drawing {
|
|
id String @id @default(uuid())
|
|
name String
|
|
elements String // Stored as JSON string
|
|
appState String // Stored as JSON string
|
|
files String @default("{}") // Stored as JSON string
|
|
preview String? // SVG string for thumbnail
|
|
version Int @default(1)
|
|
collectionId String?
|
|
collection Collection? @relation(fields: [collectionId], references: [id])
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Library {
|
|
id String @id @default("default") // Singleton pattern - use "default" ID
|
|
items String @default("[]") // Stored as JSON string array of library items
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
username String? @unique
|
|
email String? @unique
|
|
passwordHash String
|
|
mustResetPassword Boolean @default(false)
|
|
role String @default("USER")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model SystemConfig {
|
|
id String @id @default("default")
|
|
registrationEnabled Boolean @default(false)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|