I'm struggling with Prisma data modeling and have tried almost everything to resolve an error I keep getting. The error states that the table needs a default value even though I have already assigned it an ID. I attempted to remove the relation name, but encountered the same issue. Here is my model:
model UserToUser {
id Int @id @default(autoincrement())
userId Int?
follower User? @relation("follower",fields: [userId], references: [id])
following User @relation("following", fields: [followingId], references: [id])
followingId Int
}
Another error message appears stating "Step 2 Added the required column followingId to the UserToUser table without a default value. There are 2 rows in this table, so it is not possible to execute this step." How can I resolve this issue?
model User {
id Int @id @default(autoincrement())
points Int @default(0)
email String @unique
password String
name String?
posts Post[]
Profile Profile?
About About?
Update Update[]
Liked Liked[]
following UserToUser[] @relation("following")
follower UserToUser[] @relation("follower")
}