Update auth, users, settings page, and prisma schema
This commit is contained in:
@@ -18,10 +18,16 @@ datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
enum UserRole {
|
||||
ADMIN
|
||||
USER
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
password String
|
||||
role UserRole @default(USER)
|
||||
patients Patient[]
|
||||
appointments Appointment[]
|
||||
staff Staff[]
|
||||
|
||||
@@ -6,11 +6,11 @@ function formatTime(date: Date): string {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Create multiple users
|
||||
// Create multiple users (role: ADMIN | USER)
|
||||
const users = await prisma.user.createMany({
|
||||
data: [
|
||||
{ username: "admin2", password: "123456" },
|
||||
{ username: "bob", password: "123456" },
|
||||
{ username: "admin2", password: "123456", role: "ADMIN" },
|
||||
{ username: "bob", password: "123456", role: "USER" },
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user