diff --git a/prisma/schema.prisma b/prisma/schema.prisma index edd1865..210885d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,6 +1,7 @@ generator client { provider = "prisma-client-js" previewFeatures = ["referentialIntegrity"] + output = "../.prisma/client" } datasource db { @@ -13,24 +14,24 @@ model User { id Int @id @default(autoincrement()) firstname String lastname String - email String + email String @unique password String posts Post[] - roleId Int - Role Role @relation(fields: [roleId], references: [id]) + role Role @default(USER) } -model Role { - id Int @id @default(autoincrement()) - name String - users User[] +enum Role { + USER + ADMIN } model Post { - id Int @id @default(autoincrement()) - title String - content String - image String - authorId Int - author User @relation(fields: [authorId], references: [id]) + id Int @id @default(autoincrement()) + title String + content String? + image String? + authorId Int + author User @relation(fields: [authorId], references: [id]) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt }