I use Prisma as an ORM and had to change remove some columns and add others. I've already updated the database with the new columns and recreated the prisma schema but the problem is that now every time I try to insert a new entry, I get this error:
Unknown arg "picture" in create.picture for type usersCreateInput. Did you mean "image"?
"picture" is one of the new columns and "image" is one of the deleted ones, it seems that the generated types are not being updated properly, cause one of the new columns is there (email_verified), but the other (picture) isn't.
type usersCreateInput {
name?: String | Null
email?: String | Null
email_verified?: DateTime | Null
image?: String | Null
mentor?: Boolean | Null
weekly_time?: Int | Null
journey?: String | Null
pronouns?: String | Null
occupation?: String | Null
description?: String | Null
created_at?: DateTime
updated_at?: DateTime
skills?: usersCreateskillsInput | List<String>
boards?: boardsCreateNestedOneWithoutUsersInput
}
These are exactly the steps I did:
- Changed the init.sql file used by Docker
- Recreated the DB based on the new init.sql
- Deleted the existent schema, then
npx prisma init - Run
npx prisma db pullandnpx prisma generateto recreate the schema based on the already existent database,and it's important to note that I checked the schema and it's correct:
model users {
id Int @id @default(autoincrement())
name String? @db.VarChar(255)
email String? @unique(map: "email") @db.VarChar(255)
email_verified Boolean?
picture String?
mentor Boolean?
skills String[]
weekly_time Int?
journey String? @db.VarChar(255)
pronouns String? @db.VarChar(255)
occupation String?
description String? @db.VarChar(255)
created_at DateTime @default(now()) @db.Timestamptz(6)
updated_at DateTime @default(now()) @db.Timestamptz(6)
boards boards?
sessions sessions[]
}
Is there a way to completely reset prisma? I've also tried to remove node_modules and install everything again but it didn't solve.