I am using Prisma with a Node (TS) application. I have a table which is defined in schema as follows:
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
email String @db.VarChar(255) @unique
name String @db.VarChar(255)
password String @db.VarChar(255)
}
I have created migrations, deployed them to the database, created a client module also. Once the migration was deployed, I could see the table created in the database. I added some rows manually to the database. (without Prisma Client). Let us say, I add rows with id = 1, id = 2 and id = 3.
Now when I try to add a row using Prisma Client, it fails to create an entry in the DB. The error mentions that it can't create an entry because the id is conflicting. I am assuming it is trying to make an id = 1 entry since the client doesn't seem to have identified the existing last id.
How can we work around this? I don't want to delete those rows.