ezeikel
03/16/2019, 6:53 PM// datamodel.prisma
enum Permission {
ADMIN
USER
PERMISSIONUPDATE
}
enum Gender {
MALE
FEMALE
NONBINARY
NOTSPECIFIED
}
type User {
id: ID! @id
name: String
username: String @unique
website: String
bio: String
email: String! @unique
phoneNumber: Int
gender: Gender!
following: [User!]! @relation(name: "Following", link: INLINE)
followers: [User!]! @relation(name: "Followers", link: INLINE)
password: String!
resetToken: String
resetTokenExpiry: String
posts: [Post!]! @relation(name: "Posts", link: INLINE)
permissions: [Permission!]!
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
type Post {
id: ID! @id
author: User! @relation(name: "Author", link: INLINE)
image: String
caption: String
location: Location
published: Boolean @default(value: false)
likes: [User!]! @relation(name: "Likes", link: INLINE)
comments: [Comment!]!
createdAt: DateTime! @createdAt
}
type Location @embedded {
latitude: Float!
longitude: Float!
}
type Comment @embedded {
text: String!
writtenBy: User!
createdAt: DateTime! @createdAt
}Harshit
03/18/2019, 3:10 PM--force deploy this change as renaming is not quite possible