Ruslan Baigunussov
08/19/2019, 7:10 AMenum Gender {
MALE
FEMALE
}
type User {
id: Int! @id
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
firstName: String!
lastName: String!
gender: Gender!
birthday: DateTime!
email: String! @unique
password: String!
phone: String @unique
avatar: Picture
usersToClubs: [UserToClub!]
}
type Club {
id: Int! @id
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
name: String! @unique
description: String
location: Location
avatar: Picture
usersToClubs: [UserToClub!]
}
enum ClubRole {
MEMBER
MANAGER
}
type UserToClub @relationTable {
user: User!
club: Club!
role: ClubRole!
}
but get an error java.util.NoSuchElementException: None.get at scala.None$.get(Option.scala:349) when prisma deploy
If change type UserToClub to
type UserToClub {
id: Int! @id
user: User!
club: Club!
role: ClubRole!
}
everything is works, but I don't need id field in this tableDeepak Pathak
08/19/2019, 7:14 AMUserToClub table. Because there may be duplicates there, if you insert same (User + Club + Role) more than once.Deepak Pathak
08/19/2019, 7:15 AMRuslan Baigunussov
08/19/2019, 7:22 AMDeepak Pathak
08/19/2019, 7:22 AMRuslan Baigunussov
08/19/2019, 7:24 AM@realtionTable because
type UserToClub @relationTable {
id: Int! @id
user: User!
club: Club!
role: ClubRole!
}
also throws an error